how to create random double in specific range?
Ältere Kommentare anzeigen
HI, randi function Can only generate integers in specific range.
num = randi([1,3],[1,10],'double');
how to create double numbers in range such as [0.2,1.2]?
Akzeptierte Antwort
Weitere Antworten (1)
Carolina Escobar
am 1 Apr. 2023
0 Stimmen
e = rand(0.1,1)
1 Kommentar
This will throw an error.
e = rand(0.1, 1)
As the error message indicates, the size inputs to rand must contain integer values.
Kategorien
Mehr zu Random Number Generation 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!