Home > wafo > wavemodels > tay81fun.m

tay81fun

PURPOSE ^

internal function to tay81pdf and tay81cdf.

SYNOPSIS ^

y=tay81fun(u,x,b,pdfstr )

DESCRIPTION ^

 TAY81FUN internal function to tay81pdf and tay81cdf. 
 
      Call:  y=tay81fun(u,x,b )
 
 k=find(~isreal(u))
 k=find(~isreal(x))
 k=find(~isreal(a))
 k=find(~isreal(b))

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function y=tay81fun(u,x,b,pdfstr )
002 %TAY81FUN internal function to tay81pdf and tay81cdf. 
003 %
004 %     Call:  y=tay81fun(u,x,b )
005 %
006 %k=find(~isreal(u))
007 %k=find(~isreal(x))
008 %k=find(~isreal(a))
009 %k=find(~isreal(b))
010 if nargin<4|isempty(pdfstr)
011   pdfstr='pdf';
012 end
013 pdf=strcmp(lower(pdfstr),'pdf');
014 y=zeros(size(u));
015 [y ierr] =besselj(~pdf,u.*x);
016 switch ierr(1),
017   case 0, %computation OK
018   case 1, error('Illegal arguments.')
019   case 2,   disp('Overflow.  Return Inf.')
020   case 3,   disp('Some loss of accuracy in argument reduction.')
021   case 4,   error('Complete loss of accuracy, z or nu too large.')
022   case 5,  error('No convergence.  Return NaN.')
023 end
024 [tmp ierr] =besselj(0,u./sqrt(b));
025 switch ierr(1),
026   case 0, %computation OK
027   case 1, error('Illegal arguments.')
028   case 2,   disp('Overflow.  Return Inf.')
029   case 3,   disp('Some loss of accuracy in argument reduction.')
030   case 4,   error('Complete loss of accuracy, z or nu too large.')
031   case 5,  error('No convergence.  Return NaN.')
032 end
033 
034 
035 if pdf, % pdf
036    y=y.*u.*real(tmp.^b);
037 else % cdf
038    y=y.*u.*x.*real(tmp.^b);
039 end
040    return
041 
042 
043 
044

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003