How do i plot a line between vectors of 3d points?

2 ビュー (過去 30 日間)
Maurice Stancil
Maurice Stancil 2016 年 11 月 17 日
編集済み: Jan 2016 年 11 月 17 日
Are there any suggestions on how to manipulate plot3 to draw a line between vectors containing the components of individual 3d points? For instance let say I have 6 column vectors X1, Y1, Z1, X2, Y2, Z2. Where X1=[x1,x2,....xn], and Y1=[y1,y2....yn] and so on, but all in column form. I know I need to use plot3 but how can I make it plot a line from (x1,y1,z1) to (x2,y2,z2)? Thank you for any help or assistance you may have.
  1 件のコメント
Jan
Jan 2016 年 11 月 17 日
"X1=[x1,x2,....xn]" looks like a row-vector, not a column-vektor.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2016 年 11 月 17 日
編集済み: Jan 2016 年 11 月 17 日
Does this work?
X = [X1.', X2.'];
Y = [Y1.', Y2.'];
Z = [Z1.', Z2.'];
plot3(X, Y, Z)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by