spm_mrdivide.m 753 B

1234567891011121314151617181920
  1. function D = spm_mrdivide(A, B)
  2. % Regularised variant of mrdivide(A, B) or A / B, similar to B * spm_inv(A)
  3. % FORMAT D = spm_mrdivide(A, B)
  4. %
  5. % D = B * inv(A), or if A is near singular D = B * inv(A + TOL*eye(size(A))
  6. %
  7. % where TOL is adaptively increased if necessary.
  8. %
  9. % This function should be preferable to B * spm_inv(A) if A is large and
  10. % sparse or if B has few rows, since the inverse need not be explicitly
  11. % computed (the linear system can be solved with the backslash operator).
  12. %
  13. % See also: spm_mldivide
  14. %__________________________________________________________________________
  15. % Copyright (C) 2011 Wellcome Trust Centre for Neuroimaging
  16. % Ged Ridgway
  17. % $Id: spm_mrdivide.m 4360 2011-06-14 16:46:37Z ged $
  18. D = spm_mldivide(B', A')';