I have a function with two outputs as such
function [cost,correlation] = opt(beta, data, ind)
I am minimizing the cost function, using options with fmincon
I can plot beta
and cost
at each iteration and they are saved. How can I do the same with correlation (even though it is not part of the optimization, I would like to track this)