function sys = xperm_(sys,perm)
%

% Copyright 1986-2014 The MathWorks, Inc.
Data = sys.Data_;
for ct=1:numel(Data)
   try
      Data(ct) = xperm(Data(ct),perm);
   catch ME
      if isa(sys,'genss')
         if ct>1
            error(message('Control:transformation:xperm3',ct))
         else
            error(message('Control:transformation:xperm2'))
         end
      else
         if ct>1
            error(message('Control:general:RequiresUniformNumberOfStates','xperm'))
         else
            throw(ME)
         end
      end
   end
end
sys.Data_ = Data;