values of randi function repeat themselves
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
while using the function randi that generate random integers uniformly disterbuted i sometimes get in the output vector the same numbers for example:
4 2 5 3 4 8 7 9 7 4
(the number 4 was three times in the row above)
how can i avoid this?
locTX=randi([1 20],1,4);
0 Commenti
Risposta accettata
Azzi Abdelmalek
il 30 Ago 2014
Modificato: Azzi Abdelmalek
il 30 Ago 2014
4 Commenti
Image Analyst
il 31 Ago 2014
rand() and randi() are uniform. randn() is normally/Gaussian distributed. You might want to edit your post (body and subject line) to get rid of randni to avoid confusing people with a function that you say you don't use.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!