How i can insert a random integer between two numbers?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a variable and i want it to take a randome integer between numbers 2 and 101
0 Kommentare
Antworten (2)
Thomas Koelen
am 22 Apr. 2015
Bearbeitet: Thomas Koelen
am 22 Apr. 2015
a=uint16(2+rand*99)
0 Kommentare
Star Strider
am 22 Apr. 2015
The randi function is perfect for this:
rv = randi([2 101]);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!