粗略绘北京经纬度海拔地形图【MATLAB】
2022-01-06 本文已影响0人
小小杨树
部分北京点位数据.jpg
参考上述数据,粗略绘制北京市三维地形图
clc
clf
clear
close all
%%
data = [116.37 40.08 28.6
116.17 39.59 45.8
115.58 40.27 487.9
116.52 40.23 71.8
116.38 40.22 75.7
117.07 40.39 293.3
117.07 40.1 32.1
116.38 39.55 43.3
116.3 39.57 35.5
116.13 40.13 76.2
115.41 39.58 440.3
116.06 39.56 92.7
116.28 39.48 31.3
116.12 39.57 65.6
116.15 39.52 55.2
116.21 39.43 37.6
116.12 39.46 39.2
115.44 39.44 407.7];
x=data(:,1);y=data(:,2);z=data(:,3);
[X,Y,Z]=griddata(x,y,z,linspace(min(x),max(x))',linspace(min(y),max(y)),'v4');%插值
figure
surf(X,Y,Z)
colorbar
image.png