jmax = 21; jmax = Enter('jmax = ',jmax);

J = [1:jmax];
JP = J+1;  JP(jmax) = 1;
JM = J-1;  JM(1) = jmax;
JMM = JM-1;  JMM(2) = jmax;
JPP = JP+1;  JPP(jmax-1) = 1;

dx = 2*pi/jmax;
dx = 1.0;
isw = 0;
  
a = 1;
figure;
while isw >= 0
  isw = menu('','Central Periodic','1st Back Periodic','2nd Back Periodic', ...
  'Central NonPeriodic','1st Back NonPeriodic','2nd Back NonPeriodic', ...
  'Central 1st O BC','Central 2nd O BC', ...
  'stop')-1;

    
  if isw == 8     break; end
  A = -formA(jmax,dx,a,isw);

  cho = menu('choices','Eigenvalues','spy(A)','display eigenvalues');
  if cho == 1 | cho == 3
    eigen = eig(A);
    if cho == 3
      eigen'
    else
      if isw == 0 
	plot(real(eigen),imag(eigen),'ro');
      elseif isw == 1
	plot(real(eigen),imag(eigen),'bo');
      elseif isw == 2
	plot(real(eigen),imag(eigen),'go');
      elseif isw == 3
	plot(real(eigen),imag(eigen),'rx');
      elseif isw == 4
	plot(real(eigen),imag(eigen),'bx');
      elseif isw == 5
	plot(real(eigen),imag(eigen),'gx');
      elseif isw == 6
	plot(real(eigen),imag(eigen),'co');
      elseif isw == 7
	plot(real(eigen),imag(eigen),'cx');
      end
      hold on;
    end
  else cho == 2
    figure; spy(A);
  end
end