how to flatten a matrix in row major order

조회 수: 1,066 (최근 30일)
Kaushik
Kaushik 2012년 11월 19일
댓글: Walter Roberson 2015년 8월 16일
hi , how do i flatten a matrix in row major order. thanks.

채택된 답변

Matt J
Matt J 2012년 11월 19일
reshape(A.',1,[])

추가 답변 (1개)

Zhendong Zhao
Zhendong Zhao 2015년 8월 16일
B=A'; B(:)'
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 8월 16일
Using ' instead of .' makes extra work because ' is conjugate transpose. Your code does the conjugate transpose twice so you do end up with the original values, but it is work that doesn't have to be done.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by