by given 2 points in space: (x1,y1,z1), (x2,y2,z2) how can I make linear line between them and get bigger vector with x,y,z position i.e vector in size 3x100 - 3 to indicates x,y,z and 100 for the number of points (100 is just for example, it can be changed.

 採用された回答

John D'Errico
John D'Errico 2015 年 12 月 10 日
編集済み: John D'Errico 2015 年 12 月 10 日

1 投票

Easy, peasy. Pick two points (of my arbitrary choosing.)
P1 = [1 2 3];
P2 = [7 5 -2];
n = 100;
t = linspace(0,1,n)';
P = (1-t)*P1 + t*P2;

1 件のコメント

Kalonymus
Kalonymus 2015 年 12 月 10 日
編集済み: Kalonymus 2015 年 12 月 10 日
Thank you John!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2015 年 12 月 10 日

編集済み:

2015 年 12 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by