function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = xpermDF(sys,perm,varargin)
% Permutes state order.

%   Copyright 2022 The MathWorks, Inc.
[A,B,C,D,E,dx0,x0,u0,y0,Delays] = sys.DataFunction(varargin{:});
A = A(perm,perm);
B = B(perm,:);
C = C(:,perm);
if ~isempty(E)
   E = E(perm,perm);
end
if ~isempty(dx0)
   dx0 = dx0(perm,:);
end
if ~isempty(x0)
   x0 = x0(perm,:);
end
