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

  1. function [vc, vl] = vca(a)
  2. % VCA  Calculate the eigensystem of the covariance matrix.
  3. %
  4. % Copyright (c) 1989-92 by The MathWorks, Inc.
  5. %
  6. %        VCA calculates the eigenvectors and eigenvalues of
  7. %        the covariance matrix of an absorbance matrix.
  8. %
  9. %  [vc, vl] = vca(a)
  10. %
  11. % Where:
  12. %
  13. %  vc   is the matrix containing the eigenvectors (factors)
  14. %  vl   is the column vector containing the eigenvalues
  15. %  a    is the absorbance matrix
  16. %
  17. [vc, vl] = eig(a * a');
  18. [vl, k] = sort(diag(vl));
  19. vl = rot90(vl, 2);
  20. k = rot90(k, 2);
  21. vc = vc(:, k);
  22.