Home > . > qnorm.m

qnorm

PURPOSE ^

QNORM The normal inverse distribution function

SYNOPSIS ^

function x = qnorm(p,m,s)

DESCRIPTION ^

QNORM       The normal inverse distribution function

         x = qnorm(p,Mean,StandardDeviation)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function  x = qnorm(p,m,s)
0002 %QNORM       The normal inverse distribution function
0003 %
0004 %         x = qnorm(p,Mean,StandardDeviation)
0005 
0006 %       Anders Holtsberg, 13-05-94
0007 %       Copyright (c) Anders Holtsberg
0008 
0009 if nargin<3, s=1; end
0010 if nargin<2, m=0; end
0011 
0012 if any(any(abs(2*p-1)>1))
0013    error('A probability should be 0<=p<=1, please!')
0014 end
0015 if any(any(s<=0))
0016    error('Parameter s is wrong')
0017 end
0018 
0019 x = erfinv(2*p-1).*sqrt(2).*s + m;
0020

Generated on Fri 16-Jun-2006 09:09:06 by m2html © 2003