I have a 3X3 matrix and want to select its elements in order of their increasing numerical value for a loop operation. How can I do it.
For example if
x = {{1, 4, 6}, {2, 5, 8}, {11, 14, 16}},
I want a use script which can feed its elements in increasing numerical values (1, 2, 4, ...etc) in a "For" operation along with their i&j values.
For[Xmin, Xmax, X++, Print[X, i, j]]
should be able to give
{1, 1, 1}
{2, 2, 1}
{4, 2, 1}
----
etc.
I want to know what script I should use for "X" thanks
SortBy[Flatten[MapIndexed[List, {{1, 4, 6}, {2, 5, 8}, {11, 14, 16}}, {2}], 1], First]
$\endgroup$List
withFlatten@*List
. $\endgroup$