フィルターのクリア

how to select the top 5 five values in a matrix

37 ビュー (過去 30 日間)
jaah navi
jaah navi 2019 年 3 月 28 日
編集済み: madhan ravi 2019 年 3 月 28 日
If A=rand(5,15) whch generates 5 rows with 15 columns
Could anyone help me how to select the highest 5 values in A.

採用された回答

madhan ravi
madhan ravi 2019 年 3 月 28 日
編集済み: madhan ravi 2019 年 3 月 28 日
maxk(A(:),5) % gives the max 5 values of entire matrix
%or
max(A,[],2) % gives max of each row (finally resulting with 5 values)
  2 件のコメント
jaah navi
jaah navi 2019 年 3 月 28 日
ok.
with respect to command max(A,[],2) it gives one maximum value for each row,could you please help me to find 5 maximum values for each row.
madhan ravi
madhan ravi 2019 年 3 月 28 日
編集済み: madhan ravi 2019 年 3 月 28 日
Your question is answered here.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by