How to generate random number within a range?

1 view (last 30 days)
I want to generate a random number between 0.2 to 1

Accepted Answer

Stephen23
Stephen23 on 27 Jan 2020
>> 0.2+(1-0.2)*rand()
ans =
0.85178

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!