function M = char(A)
%CHAR   Convert matrix or scalar sym to string.
%   CHAR(A) converts A to its string representation.
%   If A is a vector or a matrix, the result has the form 'array([[...]])'.

%   Copyright (c) 1993-98 by The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 1997/11/29 01:05:20 $

if all(size(A) == 1)
   % Scalar
   M = A.s;

else
   % Matrix
   M = 'array([';
   for i = 1:size(A,1)
      M = [M '['];
      for j = 1:size(A,2)
         M = [M A(i,j).s ','];
      end
      M(end:end+1) = '],';
   end
   if M(end) == ','
      M(end) = [];
   end
   M = [M '])'];
end
