Hello,
I'd like to interpolate my map below based on z = f(x,y) with interp2, but it seems like interp2 can't handle it if the y-coordinate is not fixed, but changes depending on it's position in the map. This leads to an area in the contour-plot that is not allocated with data.
contour(x,y,z)
e.g. a snippet of y:
-688.2593 -661.9470
-687.8115 -661.3321
-687.3288 -660.7753
-687.0811 -660.3903
all the variables have the same size and are plottable, but i cant use interp2:
% Define the input data
x = x(:,1:18); % size 18x18
y = y(:,1:18); % size 18x18
z = z(:,1:18); % size 18x18
% Define the interpolation grid
x_interp = 2000;
y_interp = 50;
% Perform interpolation
interp_func = interp2(x, y, z,x_interp,y_interp);
ERROR:
Error using griddedInterpolant
Grid arrays must have NDGRID structure.
Error in interp2>makegriddedinterp (line 226)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 134)
F = makegriddedinterp(X, Y, V, method,extrap);
Error in parameter_interpolation (line 13)
interp_func = interp2(x, y, z,x_interp,y_interp);
Have you encountert similar issues? Or give me a hint how to overcome this?
Thank you very much!!!