How to use Matlab to generate a discrete uniformly distributed decimal with a value range of {0, 0.05} and a step size of 0.01?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
yuxiao qi
am 29 Mai 2024
Bearbeitet: John D'Errico
am 3 Jun. 2024
The randi function in matlab generates uniformly distributed pseudo-random integers. If I want to generate discrete uniformly distributed random values (decimals) in the range of {0,0.05} and a step size of 0.01, how can I do it?
1 Kommentar
John D'Errico
am 3 Jun. 2024
Bearbeitet: John D'Errico
am 3 Jun. 2024
@yuxiao qi Why did you need to post this exact question again 5 days later, (now closed as a duplicate), when you already accepted an enswer to this question? Are you testing us to see if we remember it was you?
Akzeptierte Antwort
Star Strider
am 29 Mai 2024
Perhaps something like this —
rv = randi([0 5], 1, 100)/100
figure
histogram(rv, 5)
grid
.
7 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



