How to print the second largest of a group of the numbers
9 次查看(过去 30 天)
显示 更早的评论
Example: number : 1 2 3 4 5 6 7 8 9 10
second largest = 9
0 个评论
回答(2 个)
Mischa Kim
2014-10-6
Rodrigo, you could use
a = [1 2 3 4 5 6 7 8 9 10];
b = max(setxor(a,max(a)));
0 个评论
另请参阅
类别
在 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!