function X = mrdivide(B, A)
%MRDIVIDE Symbolic matrix right division.
%   MRDIVIDE(B,A) overloads symbolic B / A.
%   X = B/A solves the symbolic linear equations X*A = B.
%   Warning messages are produced if X does not exist or is not unique.  
%   Rectangular matrices A are allowed, but the equations must be
%   consistent; a least squares solution is not computed.
    
%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.11 $  $Date: 1997/11/29 01:05:54 $

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

if all(size(A) == 1)
   % Division by a scalar.
   X = rdivide(B,A);

elseif size(A,2) ~= size(B,2)
   error('Matrix dimensions must agree.')

else
   % Matrix divided by matrix
   X = (A.'\B.').';
end
