Home > eeg > egis > spline > sph_elec.m

sph_elec

PURPOSE ^

sh = sph_elec(x,y,z,n)

SYNOPSIS ^

function sh = sph_elec(x,y,z,n);

DESCRIPTION ^

sh = sph_elec(x,y,z,n)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function sh = sph_elec(x,y,z,n);
0002 %sh = sph_elec(x,y,z,n)
0003 if size(x,1) ~= 1
0004     error('too many rows')
0005 end;
0006     [az,el,r] = cart2sph(x,y,z);
0007     el = (pi/2)*ones(size(el,1),size(el,2)) - el;
0008     ass = legendre(n,cos(el));
0009     sh = zeros(2*n+1,size(el,2));
0010     for i=-n:n
0011         if i >= 0
0012             sh(i+n+1,:) = ass(abs(i)+1,:).*cos(abs(i)*(az));
0013         else
0014             sh(i+n+1,:) = ass(abs(i)+1,:).*sin(abs(i)*(az));
0015     end;
0016 end;

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