MATLAB Answers

Kaushik

how to flatten a matrix in row major order

Asked by Kaushik
on 19 Nov 2012
Latest activity Commented on by Walter Roberson
on 16 Aug 2015 at 19:17
Accepted Answer by Matt J

hi , how do i flatten a matrix in row major order. thanks.

  0 Comments

Products

No products are associated with this question.

2 Answers

Matt J
Answer by Matt J
on 19 Nov 2012
 Accepted answer
reshape(A.',1,[])

  0 Comments


Answer by Zhendong Zhao
on 16 Aug 2015 at 18:46

B=A'; B(:)'

  1 Comment

Walter Roberson
on 16 Aug 2015 at 19:17

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.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today