[D,x] = cheb(40); % cheb.m from Trefethen's "Spectral Methods in MATLAB" A = D^2/1600 + D/40; A = A(2:end-1,2:end-1); opts.npts=50; opts.ax = [-3.75 0.25 -1.25 1.25]; opts.levels = -10:-1; eigtool(A,opts)