recursive orthogonalization of basis functions FORMAT x = spm_orth(X) serial orthogionalization starting with the first column _______________________________________________________________________ @(#)spm_orth.m 2.1 Karl Friston 02/02/07
0001 function x = spm_orth(X) 0002 % recursive orthogonalization of basis functions 0003 % FORMAT x = spm_orth(X) 0004 % 0005 % serial orthogionalization starting with the first column 0006 %_______________________________________________________________________ 0007 % @(#)spm_orth.m 2.1 Karl Friston 02/02/07 0008 0009 x = X(:,1); 0010 for i = 2:size(X,2) 0011 D = X(:,i); 0012 D = D - x*(pinv(x)*D); 0013 if any(D) 0014 x = [x D]; 0015 end 0016 end 0017