Is there any way to code this on a different way?
2 次查看(过去 30 天)
显示 更早的评论
I want to get the max value of a variable and the number #100(max). I got this code:
[b,index] = maxk(lat1,100);
b_new = b([1,100])
Is there any way to write it to get directly the #1 and #100?
采纳的回答
Jan
2022-2-16
No. This is the efficient solution already. To get the 100.th most frequent element, you have to determine the frequencies of all other elements also.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!