MATLAB Answers

[Help me, please] How to find 3 point maximum matrix in matlab ?

5 views (last 30 days)
Lee Bruce
Lee Bruce on 7 Jun 2017
Commented: Lee Bruce on 7 Jun 2017
A=[7 5 3 9 2 4;1 2 4 6 3 3]' how to result 3 point max:
A= 7 1
5 2
3 4
9 6
2 3
4 3
X= 9 7 5
Y= 6 1 2
Thank you for watching, i hope an answers.
My english is bad.

Accepted Answer

H ZETT M
H ZETT M on 7 Jun 2017
I am not sure if this is what you wanted, but I managed to recreate what the code should be doing to get your results.
A=[7 5 3 9 2 4;1 2 4 6 3 3]'
[B,I]=sort(A(:,1),'descend')
X=(B(1:3))'
Y=A(I(1:3),2)'

More Answers (1)

Community Treasure Hunt

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

Start Hunting!