MATLAB: How can i flip a (M x N) matrix to (N x M)

arraycellmatrix

i want to reverse the columns and lines in a matrix how can i do it?

Best Answer

There are two ways to do it:-
A = [1 ,2 ; 3, 4] ;
Flipped_A = transpose(A) ;
2. Put a single-quote to the end of variable
A = [1 ,2 ; 3, 4] ;
Flipped_A = A' ;