This is a problem related to create random number with matlab...
1 view (last 30 days)
Show older comments
I want to create a series of random numbers meet exponential distribution between the interval:[15,145]....How should I write the programme?(The matlab version I use now is matlab 7.0)
0 Comments
Answers (1)
Walter Roberson
on 4 Sep 2015
If you have the Statistics Toolbox then you can use exprnd and then discard values that are outside our target range. Keep generating samples and discarding unwanted ones until you have enough samples for your purpose.
Note: the exponential distribution has an infinite tail, so when you restrict to a particular finite range, the resulting numbers with not have a measured exponential distribution.
0 Comments
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!