recursive orthogonalization of basis functions FORMAT x = pr_spm_orth(X) serial orthogionalization starting with the first column _______________________________________________________________________ Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0001 function x = pr_spm_orth(X) 0002 % recursive orthogonalization of basis functions 0003 % FORMAT x = pr_spm_orth(X) 0004 % 0005 % serial orthogionalization starting with the first column 0006 %_______________________________________________________________________ 0007 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience 0008 0009 % Karl Friston 0010 % $Id: spm_orth.m 112 2005-05-04 18:20:52Z john $ 0011 0012 0013 x = X(:,1); 0014 for i = 2:size(X,2) 0015 D = X(:,i); 0016 D = D - x*(pinv(x)*D); 0017 if any(D) 0018 x = [x D]; 0019 end 0020 end 0021