Conversion of an matrix array

2 ビュー (過去 30 日間)
Ajay Kumar
Ajay Kumar 2019 年 1 月 25 日
コメント済み: madhan ravi 2019 年 1 月 28 日
How to convert a 50x50 matrix into 1x2500 matrix in matlab?

採用された回答

madhan ravi
madhan ravi 2019 年 1 月 25 日
reshape(matrix,1,[])
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 1 月 25 日
Note that this will proceed column by column, giving
 
[M(1,1), M(2,1), M(3,1), ... M(50,1), M(1,2), M(2,2), ... ]
This is one of the very fastest operations in MATLAB, as the data is not change: there is just a change to the header saying how to interpret the data.
If you want to proceed row by row,
[M(1,1), M(1,2), M(1,3), ... M(1,50), M(2,1), M(2,2) ....]
then you need
reshape(YourMatrix.', 1, []);
madhan ravi
madhan ravi 2019 年 1 月 28 日
True sir Walter , thank you!

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

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 25 日
Second way:
matrix(:).'

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by