function varargout=plotslep(G,i,fmt) % data=PLOTSLEP(G,i,fmt) % % Plots Slepian functions coming out of GLMALPHA, GLMALPHAPTO, or those % that are the direct result of diagonalizing the kernel from KERNELC % % INPUT: % % G Output from GLMALPHA or GLMALPHAPTO [default], OR % Output from diagonalizing the result of KERNELC % i The rank of the function you want plotted [default: 1] % fmt 1 The input is the output of GLMALPHA|PTO [default] % 2 The input is from diagonalizing KERNELC % Watch over the normalization, which usually depends on this! % To fix later. See GLMALPHAPTO etc. % % OUTPUT: % % data Spatial data in case coefficients were given % % Last modified by fjsimons-at-alum.mit.edu, 09/19/2009 % Set defaults defval('i',1) defval('fmt',1) % Produce and empty array [dems,dels,mz,lmcosi,mzin,b,c,d,e,ronm]=addmon(sqrt(length(G))-1); switch fmt case 1 % Construct from the GLMALPHA standard-ordered coefficients lmcosi(2*length(lmcosi)+ronm)=G(:,i); case 2 % Construct from the KERNELC standard-ordered coefficients lmcosi(:,3:4)=reshape(insert(G(:,i),0,mzin),2,length(dems))'; end % Do the standard plotting routine defval('meth',4) defval('degres',1) data=plotplm(lmcosi,[],[],meth,degres); % Prepare output if needed varns={data}; varargout=varns(1:nargout);