MATLAB: Generating random number.

MATLABmeanrandom number generatorstandard deviation

Hello,
I have 2 questions to ask:
  1. I need to generate 5 gaussian distribution data having specified stabndard deviation and particular min and max value.
  2. I need to genearate 5 gaussian distribution data having minimum distance between 2 point of 2 meter and maximum distance between 2 points as 3.5 meter.
As i had used randn function but not getting data with that particular specification.
Please help regaerding that.
Thanks

Best Answer

Well, slightly unclear question, but I'll try answering: "you need to generating some given number of random points from a Gaussian distribution with the following criteria". Since the Gaussian distribution is continuous and has infintely wide tails the only way I can see you achive this is to generate the required number of points, test if the requirements are met and then keep those otherwise draw another batch of points, repeat until stopping criteria.
Maybe there are more clever ways to achive this without introducing strange biases making the distribution of points be way off Gaussian - but that seems peculiar.
HTH
Related Question