フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

i want to write a n*n matrix into single column

1 回表示 (過去 30 日間)
SANJOY MONDAL
SANJOY MONDAL 2017 年 12 月 23 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
i have a matrix of n * n i want to arrange the same matrix in a single column with index like this
[2.3 3.5 4.5;
1.3 3.9 2.8;
3.6 5.9 2.7]
i want to see like this
1 1 2.3;
1 2 3.5;
1 3 4.5;
...
  1 件のコメント
SANJOY MONDAL
SANJOY MONDAL 2017 年 12 月 23 日
thank you sir

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 23 日
[I, J] = ndgrid(1:size(TheMatrix,1), 1:size(TheMatrix,2));
[J(:), I(:), reshape(TheMatrix.',[],1)]

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by