|
Hi all,
I need some help to optimize a code. If I have an original matrix (test_input), and the order of the elements in each column (test_order). For example,
test_input =
81 10 16
91 28 97
13 55 96
91 96 49
63 96 80
test_order =
5 2 5
2 1 4
1 3 1
3 4 3
4 5 2
I want to rearrange the elements in each column of 'test_input' according to the order in the 'test_order', so the output that I am looking for is
test_output =
63 28 80
91 10 49
81 55 16
13 96 96
91 96 97
I tried 'test_input(test_order)', but it did not work. Is there a column function that I can use here.
Thank you very much.
Wendy
|