??? Error using ==> plot3 Data must be a single matrix Y or a list of pairs X,Y

1 次查看(过去 30 天)
ans = Z{1}
[1x3 double]
ans = Z{2}
Columns 1 through 6
[1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double]
Column 7
[1x3 double]
ans = Z{3}
[1x3 double] [1x3 double]
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
??? Error using ==> plot3
Data must be a single matrix Y or a list of pairs X,Y
Error in ==> knew at 107
plot3(XYZ(:,1), XYZ(:,2), XYZ(:,3), thismap(k,:));
can anyone help ?
Thanks

回答(1 个)

Walter Roberson
Walter Roberson 2013-11-13
plot3(XYZ(:,1), XYZ(:,2), XYZ(:,3), 'Color', thismap(k,:));

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by