Hi. I want to know how to generate a random number from -1 to 1

 Accepted Answer

Numbers = (1-(-1)).*rand(100,1)+(-1)
% ^^^^^---- number of points

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Products

Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!