필터 지우기
필터 지우기

How to generate a random numbers with increase in percentage?

조회 수: 5 (최근 30일)
I need to generate a uniform random speed with minimum speed 10 m/s and maximum 40 m/s. For that I'm using :
rand_speed(step) = min_speed+rand*(max_speed-min_speed);
What I'm asking for is to generate the next random speed with 10 percent increase from the previous speed assigned.
Is there any MATLAB function that generates random speed with this constraint.
  댓글 수: 2
Roger Stafford
Roger Stafford 2016년 5월 30일
There would appear to be an inherent contradiction in the statement “next random speed with 10 percent increase from the previous speed.” Either the next speed is an exact ten percent increase or it is somehow random. The two concepts don’t match. Perhaps you mean that the expected value of the next speed should be a ten percent increase?
Dhanuja Elizabeth Thomas
Dhanuja Elizabeth Thomas 2016년 5월 30일
Sorry, like next speed is an exact 10 percent increase from previous speed.

댓글을 달려면 로그인하십시오.

채택된 답변

Roger Stafford
Roger Stafford 2016년 5월 30일
Then do
next_speed = 1.1*rand_speed

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by