include a maximum and minimum value to 'randr()' function
Ältere Kommentare anzeigen
Hello , my question is simple i need to random values that have certain conditions/limits , i looked on the help manual and it doesn'T say if it's possible with the randr() function
if no , is there another function i can use for that purpose ?
PS : i'm using at as matrix with lines and culumns
1 Kommentar
Antworten (1)
I don't know what randr() is, but consider uniform random numbers between [5 5.2];
using rand:
x = 5 + rand([1 10])*(5.2-5)
or using the attached file:
x = randrange([5 5.2],[1 10])
For integers, you can use randi(), as Yazan suggests.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!