Probability density functions (PDF) in Matlab 2012a or earlier
3 ビュー (過去 30 日間)
古いコメントを表示
Does anyone know how to calculate PDF in Matlab version 2012a or earlier?
If I used the following default code in Matlab for PDF, I'll see the following error:
mu = 0;
sigma = 1;
pd = makedist('Normal',mu,sigma);
x = [-2 -1 0 1 2];
y = pdf(pd,x)
Undefined function 'makedist' for input arguments of type 'char'.
0 件のコメント
採用された回答
Phil
2015 年 4 月 7 日
I actually just ran into this problem this morning, which resulted in me updating to a newer version of Matlab. I think this is because 2012a does not have the makedist function or the associated toolboxes to make it work. That came about in newer releases of Matlab. I know this doesn't answer your question of how to make it work, but it hopefully explains why it isn't working.
0 件のコメント
その他の回答 (1 件)
Image Analyst
2015 年 4 月 7 日
I don't know exactly what that does but if it gives you a sampling of numbers drawn from a normal distribution with a specified mu and sigma, you could use randn() instead.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!