I am fitting a function nonlinearly using the lsqnonlin function. I have used the [x, res] to return the parameters (i.e. x) and the residual (i.e. res).
I am wondering if there is any way to return the best fit of the objective function instead of returning only the parameters and the residual.