フィルターのクリア

i have the following array

3 ビュー (過去 30 日間)
mohammed elmenshawy
mohammed elmenshawy 2017 年 7 月 12 日
コメント済み: Star Strider 2017 年 7 月 13 日
Z=[22,45,65,35,65,54,45,67,84,95,86,58,29,95,93]; How to choose 5 random numbers from these numbers?? So that the output is within these numbers??

採用された回答

Star Strider
Star Strider 2017 年 7 月 12 日
One approach:
Z=[22,45,65,35,65,54,45,67,84,95,86,58,29,95,93];
Out = Z(randperm(numel(Z),5))
The randperm function will create random indices for 5 elements of ‘Z’ without repetition.
  2 件のコメント
mohammed elmenshawy
mohammed elmenshawy 2017 年 7 月 13 日
thank u very much
Star Strider
Star Strider 2017 年 7 月 13 日
My pleasure.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by