function y = utSimNonlin(sys, X)
%Simulate the idFeedforwardNetwork, idCustomNetwork,idGaussianProcess, or idTreeEnsemble
%nonlinearity (single object)
% Used by sfunnonlin S function block.

% Copyright 2007-2023 The MathWorks, Inc.

%currently, only these require simulation in MATLAB
Permitted = {'idFeedforwardNetwork','idCustomNetwork',...
   'idGaussianProcess',...
   'neuralnet','customnet','idNeuralNetwork'};
if ~any(strcmp(class(sys),Permitted))
   error(message('Ident:simulink:utSimNonlin1'))
end

X = X(:).';
y = double(soevaluate(sys,X));
