I have 100 sampled numbers, and I need to draw the normal distribution curve of them in matlab.
The mean and standard deviation of these sampled data can be calculated easily, but is there any function that plots the normal distribution?
If you have access to Statistics Toolbox, the function histfit
does what I think you need:
>> x = randn(10000,1);
>> histfit(x)
Just like with the hist
command, you can also specify the number of bins, and you can also specify which distribution is used (by default, it's a normal distribution).
If you don't have Statistics Toolbox, you can reproduce a similar effect using a combination of the answers from @Gunther and @learnvst.