clear clc [x,y]=meshgrid(1:10); % 测量数据 h=[0 .02 -.12 0 -2.09 0 -.58 -.08 0 0; .02 0 0 -2.38 0 -4.96 0 0 0 -.1; 0 .1 1 0 -3.04 0 -.53 0 .1 0 ; 0 0 0 3.52 0 0 0 0 0 0; -.43 -1.98 0 0 0 .77 0 2.17 0 0; 0 0 -2.29 0 .69 0 2.59 0 .3 0; -.09 -.31 0 0 0 4.27 0 0 0 -.01; 0 0 0 5.13 7.4 0 1.89 0 .04 0 ; .1 0 .58 0 0 1.75 0 -.11 0 0 ; 0 -.01 0 0 .3 0 0 0 0 .01]; [xi,yi]=meshgrid(1:.1:10); hi=interp2(x,y,h,xi,yi,'spline'); % 二维插值,三次样条插值 surf(hi) % 绘制地貌图 xlabel('x'),ylabel('y'),zlabel('h')
来源:51CTO
作者:doubleslow;
链接:https://blog.csdn.net/qq_36607894/article/details/100021016