MATLAB Answers


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
Accepted Answer by Matt J

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



No products are associated with this question.

2 Answers

Answer by Matt J
on 19 Nov 2012
 Accepted answer



Answer by Zhendong Zhao
on 16 Aug 2015

B=A'; B(:)'

  1 Comment

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.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!