how to select highest three maximum values from each row of an matrix

10 次查看(过去 30 天)
A=rand(3,8) generates a matrix of 3 rows with 8 columns
could anyone help me how to select highest three maximum values from each row.

采纳的回答

Andrei Bobrov
Andrei Bobrov 2019-3-28
A=rand(3,8);
B = sort(A,2,'descend');
out = B(:,1:3);

更多回答(1 个)

madhan ravi
madhan ravi 2019-3-28
编辑:madhan ravi 2019-3-28
Use the same answer I gave you in your previous question.
doc maxk % read it

标签

Community Treasure Hunt

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

Start Hunting!

Translated by