Azzera filtri
Azzera filtri

How do I randomize unrepeated four integers from 4 to 11

1 visualizzazione (ultimi 30 giorni)
randomizer = randi([4 11],1,4) . But it has repeated integers. I do not want it to be repeated.

Risposte (1)

Image Analyst
Image Analyst il 2 Dic 2021
Use randperm():
randomizer = 3 + randperm(11-4+1,4)
randomizer = 1×4
11 6 9 8

Categorie

Scopri di più su Random Number Generation in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by