function [b,flag] = mat2ss(a);

% Copyright 2003-2004 The MathWorks, Inc.

flag = 0; % no conversion from a mutools object
if ~isequal(1,mat2lti(1))
   disp('MAT2LTI code has changed');
end

switch class(a)
   case{'ss' 'tf' 'zpk' 'frd'}
      b = a;
      flag = -2;
   case{'atom' 'umat' 'ufrd' 'uss'}
      b = a;
      flag = -1;
   case{'double'}
      b = mat2lti(a);
      flag = ~isequal(a,b);
   otherwise
      error('Class of input not valid')
end