include a maximum and minimum value to 'randr()' function
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuestas (1)
DGM
el 17 de Ag. de 2021
Editada: DGM
el 17 de Ag. de 2021
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.
0 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!