Conversion of an matrix array

조회 수: 3 (최근 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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by