Writing 2 vectors within matrix
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hi!
I have 2 vectores I where are written the indexes of a matrix M and J which are the values that I want to write on matrix M. Bellow I give a generic example, how can I do it automatically?
I=[1 1 1 2 2 2 3 3 3];
J=[2 4 7 3 1 4 9 6 4];
M=[2 4 7; 3 1 4; 9 6 4];
Hope you can help me!
0 件のコメント
回答 (1 件)
fred ssemwogerere
2020 年 2 月 19 日
Hello, use reshape
M=reshape(J,[3,3])';
1 件のコメント
Miguel Cardoso
2020 年 2 月 19 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!