Generating truncated Normal random and pdf using makedist with fixed sigma.
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!