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

2 views (last 30 days)
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

Answers (1)

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

Tags

Community Treasure Hunt

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

Start Hunting!