% Returns N roots to the transcendental eigenvalue condition
function B = EigenVal(EigenErr,N,del,flag=0)
  B = zeros(N,1);
  if ~flag
    x0=[0 del];                    % del is approximate spacing between roots
  else
    x0=[del/1e6 del];
  end
  for n=1:N,
    B(n)=fzero(EigenErr,x0);       % look for root in interval x0
    x0=[B(n)+del/2, B(n)+3*del/2]; % advance search range by del
  end
end
