function p = charpoly(A,x)
%CHARPOLY Symbolic characteristic polynomial.
%	CHARPOLY(A) computes the characteristic polynomial of the matrix A.
%	The result is a symbolic polynomial in 'x'. 
%
%	CHARPOLY(A,'v') uses 'v' instead of 'x'.
%
%	Except for roundoff error, charpoly(A) equals poly2sym(poly(A)) and
%	poly(A) equals sym2poly(charpoly(A)).
%
%	Example:  charpoly(gallery(3)).
%
%	See also POLY, POLY2SYM, SYM2POLY, JORDAN, EIGENSYS, SOLVE.

%	Copyright (c) 1993-95 by The MathWorks, Inc.
%	$Revision: 1.8 $  $Date: 1995/03/01 21:38:44 $

if nargin < 2, x = 'x'; end
if prod(symsize(A)) == 1
   p = symsub(x,sym(A));
else
   p = maple('charpoly',A,x);
end
