Info

此问题已关闭。 请重新打开它进行编辑或回答。

Extract minimum row value for every column in 2D matrix

1 次查看(过去 30 天)
A = [8 4; 3 6; 2 7; 1 4; 2 3;2 1;3 1; 3 5; 8 6; 8 1];
B = sortrows(A);
I want to get the following output
ans = 2 1;
2 3;
1 4;
3 5;
3 6;
2 7
I want to get only the minimum row for every column.
I have 2 1 and 3 1 in the above array. Here minimum row for column 1 is 2. so i want only 2 1 .
Similarly i have elements 1 4 and 8 4 in the above array. Here minimum row for column 4 is 1. So i want only 1 4.
Please let me know how this is done in MATLAB
Looking forward to hear from you
Thanks
Pankaja

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by