This is a Java applet which generates an N-by-N matrix with ones on the sub- and super-diagonals, +1 or -1 in the (1,J) position, +1 or -1 in the (N,N+1-K) position, and zeros everywhere else.

All eigenvalues are of the form 2*COS(a) and the eigenvectors are of the form [SIN(w+a), SIN(w+2a), ..., SIN(w+Na)]. A can have double and triple eigenvalues and can be defective. The applet will compute the eigenvalues and eigenvectors on demand.

The diagonal is zero. The matrix is singular if J=K=N.

This generator was developed by Bruce Miller of NIST based on Nick Higham's Test Matrix Toolbox for MATLAB.