(20191026)三维矩阵,绘制三维叠加(多个平面图叠加在一起)——matlab slice函数使用

输入:(3维矩阵,经度纬度和高度) 

输出:

(20191026)三维矩阵,绘制三维叠加(多个平面图叠加在一起)——matlab slice函数使用_第1张图片

代码:

%参考slice函数用法,
%https://ww2.mathworks.cn/help/matlab/ref/slice.html#mw_dd58bff6-6022-437d-b8dd-dd00121d992c
%--------------------------------------------------------------------------
close all;
load('x_final_matrix2.mat');
[x,y,z]=meshgrid(1:12,1:12,1:24);
xslice=[];
yslice=[];
zslice=[2 4 6 8 10 12 14 16 18 20 22 24];
slice(x,y,z,x_final_matrix2,xslice,yslice,zslice);
shading interp;
colormap(jet);
grid off

xlim([0,12]);
ylim([0,12]);
% zlim([0,24]);
xlabel('Latitude/(°N)','rotation',-12); %设置坐标轴标签
ylabel('Longitude/(°E)','rotation',12);
zlabel('Altitude/(km)');
view(44,12);  % 视角设定

也可以使用surf函数绘制。

 

 

你可能感兴趣的:(matlab)