Can Matlab give me a disturbance randomly from a% to b% of a number?
조회 수: 2 (최근 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에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!