Effacer les filtres
Effacer les filtres

How do I randomize unrepeated four integers from 4 to 11

1 vue (au cours des 30 derniers jours)
nabilah shuhaimi
nabilah shuhaimi le 2 Déc 2021
randomizer = randi([4 11],1,4) . But it has repeated integers. I do not want it to be repeated.

Réponses (1)

Image Analyst
Image Analyst le 2 Déc 2021
Use randperm():
randomizer = 3 + randperm(11-4+1,4)
randomizer = 1×4
11 6 9 8

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by