How can I generate a sample of 1-D random numbers following Gaussian distribution

1 次查看(过去 30 天)
I want to generate a sample of 1-D random numbers in an interval [a, b] following Gaussian distribution (using the analytical expression for probability density distribution(PDF)).

采纳的回答

Simon
Simon 2013-11-14
编辑:Simon 2013-11-14
Hi!
It seems you already found your solution on file exchange. Why don't you use it?
Your input function will be
m=0;
sigma=1;
myfun = @(x) exp(-(x - m).^2 ./ (2*sigma^2)) ./ (sigma*sqrt(2*pi));

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by