normpdf
is a function in MATLAB that calculates the value of the probability density function (pdf) of the normal distribution at a specified value.
The syntax of the function is as follows:
main.m26 chars2 lines
where x
is the value at which to calculate the pdf, mu
is the mean of the distribution, and sigma
is the standard deviation of the distribution.
Here is an example code that uses normpdf
to plot the normal distribution curve:
main.m336 chars9 lines
This code will produce a plot of the normal distribution curve with mean mu = 0
and standard deviation sigma = 1
over the range x
from -4
to 4
.
gistlibby LogSnag