How to get cost function value in MATLAB

Yes, it should evaluate and output the cost function at the current iterate.
Note that the stage cost terms are weighted with the time step that is covored by the subsequent shooting interval.

1 Like