function X = ne(A, B)
%NE     Symbolic inequality test.
%   NE(A,B) overloads symbolic A ~= B.
    
%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 1997/11/29 01:05:55 $

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 = zeros(size(A));
for k = 1:prod(size(A))
   X(k) = ~strcmp(A(k).s,B(k).s);
end

