Random Number generation with defined decimal points

3 vues (au cours des 30 derniers jours)
Yaju Rajbhandari
Yaju Rajbhandari le 6 Fév 2020
I have a limit between 1.4 and 2.5, so i need ot generate random number between these limits.

Réponses (2)

Bhaskar R
Bhaskar R le 6 Fév 2020
num = ( 2.5 - 1.4)*rand + 1.4;

Walter Roberson
Walter Roberson le 6 Fév 2020
rand*1.1+1.4

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by