how can i generate a random number between two float numbers
49 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to generate a random number between two float numbers by using
val = randi([mnval mxval],1,1)
where mxval and mnval are two float numbers. when i run the above command "First input must be a positive scalar integer value IMAX, or two integer values [IMIN IMAX] with IMIN less than or equal to IMAX." error is coming.
0 Commenti
Risposta accettata
James Tursa
il 12 Set 2018
This is one of the examples in the rand doc:
val = mnval + rand*(mxval-mnval);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!