home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 6.ddi / CHEM.DI$ / KMATRIX.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1019 b   |  29 lines

  1. function [kcal, k] = kmatrix(a, c)
  2. % KMATRIX  Calculate K-matrix calibration coefficients.
  3. %     KMATRIX calculates K-matrix calibration coefficients
  4. %             for a given set of calibration mixtures.
  5. %
  6. %  kcal = kmatrix(a, c)    or    [kcal, k] = kmatrix(a, c)
  7. %
  8. % Where:
  9. %
  10. %  kcal is the calibration matrix
  11. %  k    is the matrix containing estimated pure component spectra
  12. %  a    is the absorbance matrix
  13. %  c    is the concentration matrix
  14. %
  15. % The concentrations of components in unknown spectra can be calculated
  16. % if the unknown absorbances are set up as a vector (for 1
  17. % unknown) or a matrix (for multiple unknowns).  The unknown matrix 
  18. % can have any available name.  For example call it "u".  The 
  19. % unknown concentrations are then given by kcal * u.
  20. %
  21. % For more details, refer to pages 139 through 141 of the ASTM
  22. % publication "Computerized Quantitative Infrared Analysis".
  23. %
  24.  
  25. % Copyright (c) 1989-92 by The MathWorks, Inc.
  26.  
  27. k = a * c' * inv(c * c');
  28. kcal = inv(k' * k) * k';
  29.