function xx = evaluateStateCodeGen(t,x,u,data)

%   Author: R. Chen
%   Copyright 2022 The MathWorks, Inc.

%#codegen
statefcn = str2func([data.FcnName '_StateFcn']);
%% state network
if data.HasInputs
   if data.IsTimeInvariant
      xx = statefcn(x,u);
   else
      xx = statefcn(t,x,u);
   end
else
   if data.IsTimeInvariant
      xx = statefcn(x);
   else
      xx = statefcn(t,x);
   end
end
