home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / electronic / rlab / TestMatrix / jordbloc_r < prev    next >
Encoding:
Text File  |  1994-06-09  |  659 b   |  24 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:      Jordan block.
  4.  
  5. // Syntax:        J = jordbloc ( N, LAMBDA )
  6.  
  7. // Description:
  8.  
  9. //      J is the N-by-N Jordan block with eigenvalue LAMBDA.  
  10. //      LAMBDA = 1 is the default.
  11.  
  12. //    This file is a translation of jordbloc.m from version 2.0 of
  13. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  14. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  15.  
  16. //-------------------------------------------------------------------//
  17.  
  18. jordbloc = function ( n , lambda )
  19. {
  20.   if (!exist (lambda)) { lambda = 1; }
  21.  
  22.   return lambda*eye(n, n) + diag(ones(n-1,1),1);
  23. };
  24.