Can Matlab give me a disturbance randomly from a% to b% of a number?
3 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Matt J
2017 年 2 月 18 日
編集済み: Matt J
2017 年 2 月 18 日
ub=4*7; %upper bound
lb=.05*7; %lower bound
num=(ub-lb)*rand+lb
2 件のコメント
John D'Errico
2017 年 2 月 18 日
Hmm. I interpret the lower limit differently from the question. You may be right though.
その他の回答 (1 件)
John D'Errico
2017 年 2 月 18 日
Do you know how to generate uniform random numbers in an interval [x,y]? This is in the help for rand, so you should know, or be able to find out.
doc rand
Here, your limits are
[5,4*7]
since 4*7 is 400% of 7. Just read the help.
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!