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

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

Accepted Answer

百家乐官方网站【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 为可选项

More Answers (0)

Categories

Find more on 颜色图 in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!