Connecting points in 3D using plot3

Hi,
Suppose I have three points:
A=[1 1 1];
B=[2 2 2];
C=[3 3 3];
and suppose that I want to draw black lines connecting point A to point B to point C (in that order). How can I do this? If I try the following,
plot3(A,B,C,'k.')
this is not the correct syntax, it seems. Can you please help me see what I am doing wrong? Thank you very much.
Andrew DeYoung
Carnegie Mellon University

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 6월 3일

2 개 추천

That's because {A,B,C} the way you've called it reference the same point!
I think you want:
A=[1 2 3];
B=[1 2 3];
C=[1 2 3];
plot3(A,B,C,'k-')

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 6월 3일

0 개 추천

xyz = vertcat(A,B,C);
plot3(xyz(1,:),xyz(2,:),xyz(3,:),'k.');

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by