How to generate a random number in matlab?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Walshaikhli
am 8 Mär. 2015
Bearbeitet: Walshaikhli
am 27 Mär. 2017
How to generate a random number in matlab?
0 Kommentare
Akzeptierte Antwort
Jan
am 8 Mär. 2015
Bearbeitet: Jan
am 8 Mär. 2015
This is shown in the documentation: doc rand , especially: floating-point-numbers-within-specific-range
a = 0.01;
b = 50;
r = (b-a) * rand + a;
Reading the documentation is a very efficient way to solve such questions. The docs of Matlab are excellent.
0 Kommentare
Weitere Antworten (1)
Konstantinos Sofos
am 10 Mär. 2015
Hi,
myrandom = randi([0.01,50],1,1);
Mathworks documentation is excellent!
Regards
Siehe auch
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!