Random number generator help
3 ビュー (過去 30 日間)
古いコメントを表示
I am looking to generate random numbers between a certain set of decimal numbers (for eg: 0.3 to 0.4). I tried using rand command but if anyone has a workaround?
0 件のコメント
採用された回答
Voss
2022 年 5 月 31 日
rand gives you number(s) between 0 and 1, so with appropriate scaling and offsetting, you can use it to get number(s) from any given range:
data = 0.3 + 0.1*rand(1,100) % 100 numbers between 0.3 and 0.4
plot(data)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!