Question about random generator values.

5 ビュー (過去 30 日間)
Portgas Ace
Portgas Ace 2012 年 9 月 30 日
if i input for example
B=randperm (43)
how can i show an array having 2 or 3 numbers only from the values of randperm(43)?
example:
A1 3 27 40
A2 30 25
A3 6 12 17
and so on..

回答 (1 件)

Image Analyst
Image Analyst 2012 年 9 月 30 日
A1 = B(1:3);
A2 = B(1:2);
etc.
  2 件のコメント
Portgas Ace
Portgas Ace 2012 年 9 月 30 日
cant do that, values in B() should also be random, either 3 values or 2.
Walter Roberson
Walter Roberson 2012 年 9 月 30 日
B(1:round(rand)+2)

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

カテゴリ

Help Center および File ExchangeCluster Analysis and Anomaly Detection についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by