how to flatten a matrix in row major order

1.073 visualizaciones (últimos 30 días)
Kaushik
Kaushik el 19 de Nov. de 2012
Comentada: Walter Roberson el 16 de Ag. de 2015
hi , how do i flatten a matrix in row major order. thanks.

Respuesta aceptada

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

Más respuestas (1)

Zhendong Zhao
Zhendong Zhao el 16 de Ag. de 2015
B=A'; B(:)'
  1 comentario
Walter Roberson
Walter Roberson el 16 de Ag. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by