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!