How to store the object function output values to an array? [When I try to run it inside a for loop multiple time] Uncategorized Jan 17, 2016 T Tejdeep Gullapalli Jan 17, 2016 #1 How to store the object function output values to an array? [When I try to run it inside a for loop multiple time] M Mark L. Stone Jan 17, 2016 #2 After cvx_end, cvx_optval contains the value of the objective function. So set the array entry for that for loop iteration to cvx_optval, before beginning the next for loop iteration.