FETCH LARGEST NUMBERS

I HAVE A SET OF 10 NUMBERS .
AND I WANT THE OUT PUT TO BE THE LARGEST THREE NUMBERS FROM THE ABOVE SET....... THANKS IN ADVANCE

 採用された回答

Matt Fig
Matt Fig 2011 年 3 月 1 日

2 投票

1. Take the capslock off.
2. Sort your array in descending order. Use the SORT function.
3. Take the first 3 numbers in the sorted array.

2 件のコメント

Jijo Ninan
Jijo Ninan 2011 年 3 月 1 日
thanks for the reply ....cool idea ... i cannot take the first three number out of the array.....
Jan
Jan 2011 年 3 月 1 日
Well, Matlab can. What have you tried and where did which problems occur?
Matt Fig means: x = rand(1, 10); s = sort(x, 2, 'ascending'); largest3 = s(1:3)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by