Finding minimal vector of matrix
1 view (last 30 days)
Show older comments
Martin Sramka
on 17 Oct 2018
Answered: Star Strider
on 17 Oct 2018
Hi, I have matrix where each row represents one vector of two variables (mean and std). I would like to find the index of optimal vector which is defined by minimal mean (first column) and minimal std (second column). It is index=6 (for sixth row) for presented data. How to do this? Thank you for your answers. Martin
0.0026 0.0004
0.0024 0.0003
0.0023 0.0004
0.0027 0.0003
0.0023 0.0003
0.0023 0.0001
0.0025 0.0003
0.0026 0.0002
0.0023 0.0002
0.0025 0.0003
0.0027 0.0007
Accepted Answer
Star Strider
on 17 Oct 2018
M = [0.0026 0.0004
0.0024 0.0003
0.0023 0.0004
0.0027 0.0003
0.0023 0.0003
0.0023 0.0001
0.0025 0.0003
0.0026 0.0002
0.0023 0.0002
0.0025 0.0003
0.0027 0.0007];
[s,idx] = sortrows(M, [1 2]);
Out = idx(1)
Out =
6
0 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!