How to find the fifth largest value in a matrix
3 次查看(过去 30 天)
显示 更早的评论
Please output the fifth largest number from a two-dimensional matrix with more than 5 elements and no repeated values.
%%Problem 2
disp('PROBELM 2')
disp('Random matrix A')
A=rand(3,3)
B=unique(A)
I am stuck after making the matrix. Any help would be appreciated.
0 个评论
回答(2 个)
madhan ravi
2019-2-5
2 个评论
madhan ravi
2019-2-6
when you specify n as 5 the last number in the result is the fifth largest number
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!