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

2 views (last 30 days)
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]);

Answers (0)

Categories

Find more on Code 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!