Dear Community,
I need to do a 2D interpolation for a matrix data, but when I use the interp2, the function report error "input grid is not a valid meshgrid". I am really confused since the input grid is generated by meshgrid function. If anyone knows this issue, could you please give me some suggestions?
% original coordinate
je=167;ke=117;dy=4e-8;dz=dy;ya=[0:dy:je*dy];za=[0:dz:ke*dz];ya=ya-mean(ya);za=za-mean(za);% interpolation
load data.mat[Z,Y]=meshgrid(za,ya);aymap = interp2(Y,Z,ay,squeeze(newcord_Y),squeeze(newcord_Z));
Best Answer