how to generate a random number between the range -50 to 50?
2 views (last 30 days)
Show older comments
a=rand(1,[-50,50])
0 Comments
Answers (1)
Andrei Bobrov
on 28 Jul 2017
Edited: Andrei Bobrov
on 28 Jul 2017
a = 10*(rand()-.5)
or integer namber
a = randi([-50,50])
0 Comments
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!