Generating truncated Normal random and pdf using makedist with fixed sigma.

조회 수: 5 (최근 30일)
Pankaj
Pankaj 2016년 2월 22일
I am finding it difficult to even describe my doubt may be someone get a clue from the code. I want to generate Truncated Normal Random number from a distribution, for that purpose I have to define a pd . I can define mu and sigma for a pd, but what if I only want to define sigma only and want to provide mu as input every time. The following is not working for me:
MU{1} = 0.015;
MU{2} = 0.0001;
SIGMA{1} = 0.0001;
SIGMA{2} = 0.00005;
pd{1} = @(x) makedist('Normal', 'mu', x, 'sigma', SIGMA{1});
pd{2} = @(x) makedist('Normal', 'mu', x, 'sigma', SIGMA{2});
jumpRandX{1} = random(pd{1}, MU{1},[200, 1]);
jumpRandX{2} = random(pd{2}, MU{2},[200, 1]);

답변 (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