1function [spectrum,projectors,nihil,V,D]=spectd(A,OPT)
4elseif strcmpi(OPT,
'jordan')
24 if to==n || J(to,to+1)==0 % next
is new block
25 spectrum(end+1)=J(from,from);
26 projectors{end+1}=V*subblock(sym(eye(n)),from,to)*iV;
27 nihil{end+1}=V*subblock(diag(ones(1,n-1),1),from,to)*iV;
33 if ~strcmpi(
class(A(1,1)),
'sym')
51 projectors{end+1}=V(:,k)*iV(k,:);
55spectrum=reshape(spectrum,1,length(spectrum));
57 function X=subblock(X,from,to)