Maximum arrays of a matrix
4 次查看(过去 30 天)
显示 更早的评论
Hi i have a matrix woth 543 arrays. I wanna choose 10 maximum arrays between these 543 arrays. Need help!
4 个评论
采纳的回答
DGM
2021-12-6
If all you need to work on is a numeric vector, then
W = [3 5 4 6 7 8 66 444 33 23 4];
Wmx = maxk(W,5) % R2017b or newer
Note that maxk() is relatively new. You can also do the same thing using sort()
% any version
Wmx = sort(W,'descend');
Wmx = Wmx(1:5)
9 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!