This is a follow up on this question. Consider a matrix m1
as
m1 = {{1, 2, 3}, {4, 9, 5}, {6, 7, 8}};
In MatrixForm
it looks like
I want to rearrange the elements in a way such that it looks like
Consider another example.
m2 = {{1, 2, 3, 4, 5}, {6, 17, 18, 19, 7}, {8, 20, 25, 21, 9}, {10, 22, 23, 24, 11}, {12, 13, 14, 15, 16}};
In MatrixForm
,
And I want to transform this into
Basically, I want the boundary elements to be sorted in a counter clock-wise with the smallest element at the center-right.
How can I do this?
Comments
Post a Comment