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!