MATLAB: Normal distribution from data

normal distribution

is there a more efficient way to derive a normal distribution.
% Deriving Normal Distribution From the Data
x=0:1:12;
m=mean(Data);
s=std(Data);
p=(1/(s*sqrt(2*pi)))*exp((-(x-m).^2)/(2*s^2));

Best Answer

Here is another suggestion:
y=pdf('Normal',x,m,s);
plot(x,y);
Related Question