function X = ldivide(A, B)
%LDIVIDE Symbolic array left division.
%   LDIVIDE(A,B) overloads symbolic A .\ B.
    
%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.8 $  $Date: 1997/11/29 01:05:49 $

A = sym(A);
B = sym(B);

% Scalar expansion
if any(size(A) ~= size(B))
   if all(size(A)==1)
      A = A(ones(size(B)));
   elseif all(size(B)==1)
      B = B(ones(size(A)));
   else
      error('Matrix dimensions must agree.');
   end
end

X = A;
for k = 1:prod(size(A))
   if A(k) ~= 0
      X(k) = maple(B(k),'/',A(k));
   elseif B(k) ~= 0
      X(k) = Inf;
   else
      X(k) = NaN;
   end
end
