I need to extract data values for a particular coordinate from a meshgrid in MATLAB, my code is the following:
PaarX=Paar(:,1);
PaarX1=PaarX(1:20:length(PaarX));
PaarY=Paar(:,2);
PaarY1=PaarY(1:20:length(PaarY));
x=PaarX;
y=PaarY;
v=Paar(:,3);
[xi, yi]=meshgrid(PaarX1, PaarY1);
vq=griddata(x, y, v, xi, yi, 'cubic');
The PaarX, PaarY and v are the X, Y and Z values of the surface, with the Z values the values to be interpolated. PaarX1 and PaarY1 are the values used in the meshgrid with every 20th value taken (the array was too large before this). I need to extract interpolated Z values in vq from particular X and Y coordinates.