필터 지우기
필터 지우기

Random numbers within a specific range

조회 수: 2 (최근 30일)
msh
msh 2015년 4월 26일
편집: msh 2015년 4월 27일
Hi,
I would like to know how is possible to generate random draws from a normal distribution , where the rv has a specific range.
say within a closed interval [-5, 5].
Thanks
  댓글 수: 2
Brendan Hamm
Brendan Hamm 2015년 4월 26일
Well this would no longer be statistically normally distributed as the support is infinite.
msh
msh 2015년 4월 26일
True, I modified my question to be more precise.

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

채택된 답변

Star Strider
Star Strider 2015년 4월 26일
Considering that:
p = normpdf([-5, 5], 0, 1)
produces:
p =
1.4867e-006 1.4867e-006
so the randn function will produce normally-distributed random variables on the interval (-5,+5) with a probability of about 0.999997 or so.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by