MATLAB: How to turn the columns and rows in a random matrix

matrix turn

We have a 4×3 matrix =
[9 11 13;
10 12 14;
11 13 15;
12 14 16]
and we want to turn the columns and rows around so that it will result in
[16 14 12
15 13 11
14 12 10
13 11 9
Who knows how to do this?

Best Answer

result = flipud(fliplr(your_matrix));
or
result = reshape(your_matrix(end:-1:1),size(your_matrix));
or
result = your_matrix; result(:) = result(end:-1:1);