Random Number generation with defined decimal points

2 次查看(过去 30 天)
I have a limit between 1.4 and 2.5, so i need ot generate random number between these limits.

回答(2 个)

Bhaskar R
Bhaskar R 2020-2-6
num = ( 2.5 - 1.4)*rand + 1.4;

Walter Roberson
Walter Roberson 2020-2-6
rand*1.1+1.4

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by