Rev | Line | |
---|
[37] | 1 | function p = normcdf(x,m,s) |
---|
| 2 | %NORMCDF Normal Cumulative Density Function. |
---|
| 3 | % P = NORMCDF(X) returns the probability that a standard normal variate will |
---|
| 4 | % be less than X. |
---|
| 5 | % |
---|
| 6 | % P = NORMCDF(X,M,S) returns the probability that a normal variate with |
---|
| 7 | % mean M and standard deviation S will be less than x. |
---|
| 8 | |
---|
| 9 | if nargin > 1 |
---|
| 10 | if nargin == 3 |
---|
| 11 | x = (x-m)./s; |
---|
| 12 | else |
---|
| 13 | error('Usage: normcdf(x,m,s)'); |
---|
| 14 | end |
---|
| 15 | end |
---|
| 16 | |
---|
| 17 | p = 0.5*erf(x/sqrt(2)) + 0.5; |
---|
Note: See
TracBrowser
for help on using the repository browser.