MATLAB: How to change grid option(size of grid & granularity)

gridmeshcmeshgridsurface and mesh plots

i have this mask.and display that by meshc function?
z=[ 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000;
-0.0005 -0.0001 0.0000 0.0000 0.0000 0.0000;
0.0038 0.0001 -0.0005 -0.0000 0.0000 0.0000;
0.0074 0.0066 0.0027 -0.0003 0.0000 0.0000;
0.0054 0.0067 0.0078 0.0011 -0.0001 0.0000;
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000];
meshc(z)
how to change grid option like this image :

Best Answer

Since you have gridded data, the interp2 function is perfect for what you want to do.
EDIT ā€” To illustrate (literally):
og = [1:6]; % Original Grid (Vector)
[X,Y] = meshgrid(og); % Original Grid (Matrices)
qg = linspace(min(og), max(og), 25); % Query Grid (Vector)
[Xq,Yq] = meshgrid(qg); % Query Grid (Matrices)
zq = interp2(X,Y,z,Xq,Yq, 'spline'); % Interpolated ā€˜zā€™
figure(1)
meshc(Xq, Yq, zq)
grid on
Explore the options (grid size, interpolation method, etc.) presented in the interp2 documentation.