I am trying to create a matrix X like in the attached image. I have the vectors x,y,z denoted as DE,DN,DZ respectively.

 採用された回答

Star Strider
Star Strider 2015 年 10 月 26 日

0 投票

That is straightforward, using the (:) addressing to create column vectors regardless of their original orientation:
X = [ones(size(DE(:))) DE(:) DN(:) DZ(:)];
If you also have your ‘g’ vector (all vectors must be the same length), calculate the ‘a’ coefficients as:
a = X\g(:);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

質問済み:

2015 年 10 月 26 日

回答済み:

2015 年 10 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by