关于使用三维矩阵数据绘图的问题。

1 次查看(过去 30 天)
关于使用三维矩阵数据绘图的问题,我只能画出散点图,如图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

采纳的回答

百家乐官方网站【TL9704.com】
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 个)

类别

Help CenterFile Exchange 中查找有关 颜色图 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!