how to flatten a matrix in row major order

1 072 vues (au cours des 30 derniers jours)
Kaushik
Kaushik le 19 Nov 2012
Commenté : Walter Roberson le 16 Août 2015
hi , how do i flatten a matrix in row major order. thanks.

Réponse acceptée

Matt J
Matt J le 19 Nov 2012
reshape(A.',1,[])

Plus de réponses (1)

Zhendong Zhao
Zhendong Zhao le 16 Août 2015
B=A'; B(:)'
  1 commentaire
Walter Roberson
Walter Roberson le 16 Août 2015
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by