include a maximum and minimum value to 'randr()' function
Show older comments
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 Comment
Answers (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.
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!