how to select the top 5 five values in a matrix
37 次查看(过去 30 天)
显示 更早的评论
If A=rand(5,15) whch generates 5 rows with 15 columns
Could anyone help me how to select the highest 5 values in A.
0 个评论
采纳的回答
madhan ravi
2019-3-28
编辑:madhan ravi
2019-3-28
maxk(A(:),5) % gives the max 5 values of entire matrix
%or
max(A,[],2) % gives max of each row (finally resulting with 5 values)
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!