How to get the value of the objective function of each iteration

Get the value of each iteration

After iterating out the objective function every time, I want to put it into a vector, but matlab reports an error:The following error occurred while converting from CVX to double:
Cannot convert from CVX to double.
I make double(x) change cvx to double .it is also error!

The objective value after optimization is saved to the variable cvx_optval, in your work space of MATLAB. There are also some other cvx-related values in your work space, if you look into it.