?? Error using ==> plot3 String argument is an unknown option.

MON = [2.8 3.6 17.2;
5.4 8.3 15.8;
2.5 3.2 17.6;
9.9 10.7 13.6;
5.5 8.9 15.5;
9.7 11 13.9;
2.3 3.9 17.9;
5.7 8.1 15.1;
9.4 10.5 13;
9.9 13.2 13.7];
[m,n]=size(MON)
for j=1:n
plot3(MON(:,j),'X')
end
Error in ==> Untitled2 at 19 a=plot3(MON(:,j),'X')
string argument is an unknown option.

回答(1 个)

To use plot3, you need three vectors x,y and z. You don't need a for loop
plot3(MON(:,1),MON(:,2),MON(:,3),'x')

9 个评论

I know,but when i have matrix[450x452]?
THAKS
Ok, then tell us what you want to plot
What are your x,y and z coordinate?
i want to plot change points, i make cluster analysis and i have to plot a for loop.
i have for example 10 objects and each object have[x,y,z] coordinate,
How those [x,y,z] coordinate are stored?
MON = [2.8 3.6 17.2;
5.4 8.3 15.8;
2,5 3,2 17,6;
9.9 10.7 13.6;
5.5 8.9 15.5;
9,7 11 13,9;
2,3 3,9 17,9;
5.7 8.1 15.1;
9.4 10.5 13;
9,9 13,2 13,7];
this is coordinates
i want to plot this 10 object for loop.
You don't need a for loop, I've already answered:
plot3(MON(:,1),MON(:,2),MON(:,3),'x')
If you insist for the for loop
figure;
hold on
for k=1:size(MON,1)
plot3(MON(k,1),MON(k,2),MON(k,3),'x')
end
hold off
YEAH , THANKS YOU I already knew plot3 must have 3 input parameters

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Graphics Performance 的更多信息

标签

提问:

2013-11-9

编辑:

2013-11-9

Community Treasure Hunt

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

Start Hunting!

Translated by