Size input must be scalar using rand to generate uniformly distributed numbers
Show older comments
I want to generate a set of random numbers which contains 1000 uniformly distributed numbers on the interval [-1,1]. I am getting the error that input must be scalar.
my code:
a = rand(1000,[-1,1]);
Error:
Error using rand
Size inputs must be scalar.
Accepted Answer
More Answers (0)
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!