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

7 次查看(过去 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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by