MATLAB: The mean and std value of a standard normal distribution

homeworknormal distribution meannormal distribution stdrandn

Hello,
I used matlab example https://www.mathworks.com/help/stats/normal-distribution.html
Compute the pdf of a standard normal distribution, with parameters µ equal to 0 and σ equal to 1. The mean value of norm should be 0, and the std value of norm should be 1.
Why the mean value of norm is 0.1636, and the std value is 0.1408?
Thanks in advance!
Yue
x = [-3:.1:3];
norm = normpdf(x,0,1);
>> norm_mean=mean(norm)
norm_mean =
0.1636
>> norm_std=std(norm)
norm_std =
0.1408

Best Answer

norm() is a built-in function so don't use that for your variable name.
Try using randn() and then using mean() and std() on that.