How can I get a random number between 9.9775 and 10.0225?

I would like to generate a monte carlo simulation. I need my input values to change randomly between 9.9775 and 10.0225. How can I progamme this in matlab?

Answers (1)

>>randi([9.9775 10.0225])

4 Comments

I have tried this but the value needs to be integer
please try
>>x= 9.9775+rand*(10.0225-9.9775)
thank you. This one works :)
welcome, please accept the answer if it works :)

Sign in to comment.

Categories

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

Asked:

on 15 Nov 2017

Commented:

on 15 Nov 2017

Community Treasure Hunt

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

Start Hunting!