Calls and collect the correct amount of outputs from an objective function - used by optimisation routines of the optimal control module. this is needed because some outputs of optimal control objective functions are very expensive.
x - objective function argument objfun_handle - handle to the objective function data - data structure inherited from fminnewton.m
data - modified data structure with diagnostics from the objective fx - objective function value at x grad - gradient of the objective function at x hess - Hessian of the objective function at x
This function will be eliminated in a future release.