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

  1. function [frac] = pcrfrac(vl,maxrank)
  2. % PCRFRAC Fractional indicator function using method of Brown and Donahue.
  3. %
  4. %  frac = pcrfrac(vl,maxrank)
  5. %
  6. % Where:
  7. %
  8. %  frac    is the fractional indicator function
  9. %  vl      is the column vector of eigenvalues
  10. %  maxrank is optional limit to the number of factors tested  
  11. %
  12.  
  13. % Copyright (c) 1989-92 by The MathWorks, Inc.
  14.  
  15. [i, j] = size(vl);
  16. ii = i;
  17. frac(i,1)=0;
  18.  
  19. if nargin == 2, i = maxrank; end
  20.  
  21. for j = 1:i
  22.       frac(j) = vl(j) / sum(vl(j:ii));
  23. end
  24.  
  25.