Info

This question is closed. Reopen it to edit or answer.

Extract minimum row value for every column in 2D matrix

1 view (last 30 days)
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

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!