フィルターのクリア

How do I randomize unrepeated four integers from 4 to 11

1 回表示 (過去 30 日間)
nabilah shuhaimi
nabilah shuhaimi 2021 年 12 月 2 日
回答済み: Image Analyst 2021 年 12 月 2 日
randomizer = randi([4 11],1,4) . But it has repeated integers. I do not want it to be repeated.

回答 (1 件)

Image Analyst
Image Analyst 2021 年 12 月 2 日
Use randperm():
randomizer = 3 + randperm(11-4+1,4)
randomizer = 1×4
11 6 9 8

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by