home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / SPECMAT.DI$ / WILKINSO.M < prev   
Encoding:
Text File  |  1993-03-07  |  672 b   |  22 lines

  1. function W = Wilkinson(n)
  2. %WILKINSON Wilkinson's eigenvalue test matrix.
  3. %    WILKINSON(n) is J. H. Wilkinson's eigenvalue test matrix, Wn+.
  4. %    It is a symmetric, tridiagonal matrix with pairs of nearly,
  5. %    but not exactly, equal eigenvalues.  
  6. %    The most frequently used case is WILKINSON(21).
  7. %    For example, WILKINSON(7) is
  8. %
  9. %           3  1  0  0  0  0  0
  10. %           1  2  1  0  0  0  0
  11. %           0  1  1  1  0  0  0
  12. %           0  0  1  0  1  0  0
  13. %           0  0  0  1  1  1  0
  14. %           0  0  0  0  1  2  1
  15. %           0  0  0  0  0  1  3
  16.  
  17. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  18.  
  19. m = (n-1)/2;
  20. e = ones(n-1,1);
  21. W = diag(abs(-m:m)) + diag(e,1) + diag(e,-1);
  22.