How to generate all numbers randomly in the limit [m,n]. To generate all numbers from 6 to 12.. ie., the sequence must be like [7 12 11 9 8 10 6]. r = randi([6 12],1,7); But this gives the result [12 11 12 7 9 10 12]. Here the numbers are repeated and the sequence does not contain all numbers from 6 to 12.
Aucun commentaire:
Enregistrer un commentaire