Tag Archives: Relief Map

将未测量的地点用数据插值模拟,具体源码见下:

源码(与原源码略有改动):

[x, y] = meshgrid(1:10);
h = [0, 0.02, -0.12, 0, -2.09, 0, -0.58, -0.08, 0, 0;...
    0.02, 0, 0, -2.38, 0, -4.96, 0, 0, 0, -0.1;...
    0, 0.1, 1, 0, -3.04, 0, -0.53, 0, 0.1, 0;...
    0, 0, 0, 3.52, 0, 0, 0, 0, 0, 0;...
    -0.43, -1.98, 0, 0, 0, 0.77, 0, 2.17, 0, 0;
    0, 0, -2.29, 0, 0.69, 0, 2.59, 0, 0.3, 0;...
    -0.09, -0.31, 0, 0, 0, 4.27, 0, 0, 0, -0.01;...
    0, 0, 0, 5.13, 7.4, 0, 1.89, 0, 0.04, 0;...
    0.1, 0, 0.58, 0, 0, 1.75, 0, -0.11, 0, 0;...
    0, -0.01, 0, 0, 0.3, 0, 0, 0, 0, 0.01];
[xi, yi] = meshgrid(1:0.1:10);
hi = interp2(x, y, h, xi, yi, 'spline');
surf(hi);
colorbar('YTickLabel',{'-4','-2','0','2','4','6'})
xlabel('x'), ylabel('y'), zlabel('h')

效果如下: Read More →