How can I generate a sample of 1-D random numbers following Gaussian distribution
5 views (last 30 days)
Simon on 14 Nov 2013
Edited: Simon on 14 Nov 2013
It seems you already found your solution on file exchange. Why don't you use it?
Your input function will be
myfun = @(x) exp(-(x - m).^2 ./ (2*sigma^2)) ./ (sigma*sqrt(2*pi));
Edit: Forgot the link: 1-D random number generation with any analytical expression probability density function