关于使用三维矩阵数据绘图的问题。
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
百家乐官方网站【微8785092】
le 24 Mai 2023
Réponse apportée : 百家乐官方网站【TL9704.com】
le 24 Mai 2023
关于使用三维矩阵数据绘图的问题,我只能画出散点图,如图1,代码如下,请问这样一个三维矩阵的数据如何“拟合”出“连续”的实体图,类似图2这样的表达效果。
A(:,:,1)=[2,6,7;8,1,7;1,9,2];
A(:,:,2)=[5,3,7;8,1,1;5,9,3];
A(:,:,3)=[8,4,1;1,4,1;3,7,4];
A(:,:,4)=[2,5,4;1,6,1;1,7,5];
A(:,:,5)=[1,1,3;1,4,8;1,6,1];
[X,Y,Z]=meshgrid(1:3,1:3,1:5);
figure,scatter3(X(:),Y(:),Z(:),5,A(:),'filled')
axis equal
colormap hsv
0 commentaires
Réponse acceptée
百家乐官方网站【TL9704.com】
le 24 Mai 2023
A(:,:,1)=[2,6,7;8,1,7;1,9,2];
A(:,:,2)=[5,3,7;8,1,1;5,9,3];
A(:,:,3)=[8,4,1;1,4,1;3,7,4];
A(:,:,4)=[2,5,4;1,6,1;1,7,5];
A(:,:,5)=[1,1,3;1,4,8;1,6,1];
[X,Y,Z]=meshgrid(1:3,1:3,1:5);
slice(X,Y,Z,A,[1,3],[1,3],[1,5]);
shading interp
你需要使用slice函数。最后的 shading interp 为可选项
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!