How to generate random number within a range?

1 vue (au cours des 30 derniers jours)
VIJAY
VIJAY le 27 Jan 2020
Commenté : Stephen23 le 27 Jan 2020
I want to generate a random number between 0.2 to 1

Réponse acceptée

Stephen23
Stephen23 le 27 Jan 2020
>> 0.2+(1-0.2)*rand()
ans =
0.85178
  2 commentaires
VIJAY
VIJAY le 27 Jan 2020
thank you
Stephen23
Stephen23 le 27 Jan 2020
@VIJAY: please don't forget to accept my answer!

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by