function [Jx, Ju, Jdmv, Je] = myCostFcnwSlackStageLastJacobian(stage, x, u, dmv, e, p)
% This function was generated by Model Predictive Control Toolbox (Version 8.1).
% 08-May-2023 12:35:13
%# codegen
persistent ADdata
if isempty(ADdata)
    ADdata = coder.load('myCostFcnwSlackStageLastJacobianADdata','constants');
end
params.stage = stage;
params.p = p;
[~,J] = myCostFcnwSlackStageLastJacobianAD([x;u;dmv;e],ADdata.constants,params);
Jx = J(1:1,:);
Ju = J(3,:);
Jdmv = J(4:4,:);
Je = J(5:6,:);
