how to create random double in specific range?
古いコメントを表示
HI, randi function Can only generate integers in specific range.
num = randi([1,3],[1,10],'double');
how to create double numbers in range such as [0.2,1.2]?
採用された回答
その他の回答 (1 件)
Carolina Escobar
2023 年 4 月 1 日
0 投票
e = rand(0.1,1)
1 件のコメント
This will throw an error.
e = rand(0.1, 1)
As the error message indicates, the size inputs to rand must contain integer values.
カテゴリ
ヘルプ センター および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!