Home > eeg > egis > phantom > legendre_r.m

legendre_r

PURPOSE ^

SYNOPSIS ^

function p = legendre_r(z,nmax);

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function p = legendre_r(z,nmax);
0002 p = zeros(nmax,size(z,2));
0003 p(1,:) = z;
0004 p(2,:) = 0.5*(3*z.^2 - ones(1,size(z,2)));
0005 for n = 3:nmax
0006     p(n,:) = (z.*p(n-1,:)*(2*n-1)-(n-1)*p(n-2,:))/n;
0007 end;
0008 
0009

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003