function Y = expm(X)
%EXPM   Symbolic matrix exponential.
%   EXPM(A) is the matrix exponential of the symbolic matrix A.
%
%   Examples:
%      syms t
%      A = [0 1; -1 0]
%      expm(t*A)
%
%      A = sym(gallery(5))
%      expm(t*A)

%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.6 $  $Date: 1998/08/06 15:10:44 $

if all(size(X) == 1)
   Y = maple('exp',X);
elseif size(X,1) == size(X,2)
   [Y,stat] = maple(['evalm(exponential(' char(X) '));']);
   if stat | strncmp(char(Y),'exponential',11)
      Y = sym([]);
      warning('Explicit matrix exponential could not be found.')
   else
      Y = sym(Y);
   end
else
   error('Matrix must be square.')
end