how to plot cell ?
1 回表示 (過去 30 日間)
古いコメントを表示
I have for example cell {1x1 cell} {1x7 cell} {1x2 cell}, each cell is cluster.
I have to plot each cluster, how to plot together in one figure ?
Thanks
2 件のコメント
Walter Roberson
2013 年 11 月 12 日
編集済み: Walter Roberson
2013 年 11 月 12 日
What is the data structure inside the cells? For example is it an array of XYZ coordinates? Are you wanting to scatter3() based on the coordinates?
回答 (1 件)
Walter Roberson
2013 年 11 月 12 日
pointsize = 10;
nclust = length(Z);
colorfrac = linspace(0, 1, nclust);
clustcoords = cellfun( @cell2mat, Z, 'Uniform', 0 );
for k = 1 : length(clustcoords)
XYZ = clustcoords{k};
scatter3(XYZ(:,1), XYZ(:,2), XYZ(:,3), pointsize, colorfrac(k));
hold on
end
3 件のコメント
Walter Roberson
2013 年 11 月 12 日
nclust = length(Z);
thismap = copper(nclust); %or pink or flag or hot or ...
clustcoords = cellfun( @cell2mat, Z, 'Uniform', 0 );
for k = 1 : length(clustcoords)
XYZ = clustcoords{k};
plot3(XYZ(:,1), XYZ(:,2), XYZ(:,3), thismap(k,:));
hold on
end
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!