generate uniform random numbers between -1 and +1 in matlab

3 views (last 30 days)
how o generate uniform random numbers between -1 and +1 in matlab?

Accepted Answer

David Hill
David Hill on 14 Dec 2019
2*rand()-1;
  2 Comments
Image Analyst
Image Analyst on 14 Dec 2019
Did youi look at the help for rand()? It answers both your original question and this follow up question
randomMatrix = 2 * rand(rows, columns) - 1;
where you set rows and columns to whatever values you want.

Sign in to comment.

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!