function X = rdivide(A, B)
%RDIVIDE Symbolic array right division.
%   RDIVIDE(A,B) overloads symbolic A ./ B.
    
%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.10 $  $Date: 1997/11/29 01:06:01 $

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 B(k) ~= 0
      X(k) = maple(A(k),'/',B(k));
   elseif A(k) ~= 0
      X(k) = Inf;
   else
      X(k) = NaN;
   end
end
