find the probablility of a normal distrubution in matlab

To find the probability of a normal distribution in MATLAB, you can use the normpdf and normcdf functions.

normpdf calculates the probability density function (PDF) of the normal distribution at a given point, and normcdf calculates the cumulative distribution function (CDF) of the normal distribution up to a given point.

Here's an example of using normpdf and normcdf to find the probability of a random variable between two values a and b in a normal distribution with mean mu and standard deviation sigma:

main.m
mu = 0; % mean of the normal distribution
sigma = 1; % standard deviation of the normal distribution
a = -1; % lower bound of the probability
b = 1; % upper bound of the probability
P = normcdf(b, mu, sigma) - normcdf(a, mu, sigma); % probability of random variable between a and b
282 chars
6 lines

Here, P will give you the probability of the random variable being between -1 and 1 in a normal distribution with mean 0 and standard deviation 1.

related categories

gistlibby LogSnag