Home > marsbar > @mardo_99 > private > pr_spm_orth.m

pr_spm_orth

PURPOSE ^

recursive orthogonalization of basis functions

SYNOPSIS ^

function bf = pr_spm_orth(BF)

DESCRIPTION ^

 recursive orthogonalization of basis functions
 FORMAT bf = pr_spm_orth(bf)

 From spm_get_bf.m, see that file for credits
 
 $Id$ 

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function bf = pr_spm_orth(BF)
0002 % recursive orthogonalization of basis functions
0003 % FORMAT bf = pr_spm_orth(bf)
0004 %
0005 % From spm_get_bf.m, see that file for credits
0006 %
0007 % $Id$
0008 
0009 if nargin < 1
0010   error('Need BF');
0011 end
0012 
0013 bf    = BF(:,1);
0014 bf    = bf/sqrt(mean(bf.^2));
0015 for i = 2:size(BF,2)
0016   D     = BF(:,i);
0017   D     = D - bf*(pinv(bf)*D);
0018   if any(D)
0019     bf = [bf D/sqrt(mean(D.^2))];
0020   end
0021 end
0022 
0023 

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019