How to create the specified matrix array?

1 回表示 (過去 30 日間)
Balaji L
Balaji L 2021 年 5 月 21 日
回答済み: Matt J 2021 年 5 月 21 日
I have three matrix A = [181 x 1] Ranges from -90 to 90; B = [1 x 360] 180 to 180(non linear); C = [181 x 360].
The element C11 value is attributed to A11 and B11; C12 is attributed to A11 and B12.
I need a resultant matrix in the format of D = [(A11,B11,C11); (A11,B12,C12),…
(A21,B11,C21; (A22,B12,C22).....]
Thank you in advance.

採用された回答

Matt J
Matt J 2021 年 5 月 21 日
[BB,AA]=ndgrid(B,A);
D=[AA(:),BB(:),C(:)];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by