1的群集的3D可视化 [英] 3d visualisation of clusters of 1's
本文介绍了1的群集的3D可视化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Matlab中有一个1和0的N x N x N矩阵,我只想绘制1,就像
I have a N x N x N matrix of 1's and 0's in Matlab and I want to plot only the 1's, like in this picture (ignore the axes):
有什么建议吗?
编辑:感谢您的即时答复.如果我要计算每个簇或其表面积的大小(最小和最大直径)怎么办?
Thank you for the immediate answer. What if I want to count the size (minimum and maximum diameter) of each cluster or its surface area?
推荐答案
按照上面@Ander Biguri和@Cape代码的建议,我有以下代码,其中size(state)= N N N
Following the suggestions of @Ander Biguri and @Cape Code above, I have the following code, where size(state) = N N N
p = patch(isosurface(state,0));
isonormals(state,p)
set(p, 'FaceColor','r', 'EdgeColor','none')
daspect([1 1 1])
view(3)
axis vis3d
axis([1 N 1 N 1 N])
camlight
lighting phong
alpha(0.5)
我认为这正是我想要的!谢谢!
I think that's exactly what I wanted! Thank you!
这篇关于1的群集的3D可视化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文