how to flatten a matrix in row major order

1,099 ビュー (過去 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 Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by