how to flatten a matrix in row major order

1,070 次查看(过去 30 天)
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