フィルターのクリア

How to generate a vector of uniformly distributed numbers around 1?

1 回表示 (過去 30 日間)
christina
christina 2018 年 10 月 2 日
編集済み: Stephen23 2018 年 10 月 2 日
How to generate a vector of uniformly distributed numbers around 1 using rand function?

採用された回答

Stephen23
Stephen23 2018 年 10 月 2 日
編集済み: Stephen23 2018 年 10 月 2 日
>> 2*rand(1,10)
ans =
1.324304 0.866104 0.570201 1.248882 0.425728 1.720565 0.022849 1.249922 1.828464 1.977158
Of course you could generalize this for a particular offset and range:
off = 0.4;
wid = 1.5
off+wid*rand(...)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by