CVX in a loop and efficiency


For experiments dealing with noise we use cvx_begin inside loops, something like in

I am wondering if this is efficient since the DCP analysis of the problem does not change in the loop. Only the numerical optimization problem needs to be solved at every iteration since the matrices change (the actual numerical values of their elements).

Is there a way to do this more efficiently with CVX?


Unfortunately, not in CVX.

YALMIP allows creation of an optimizer object , which allows most of the model creation process to be performed just once, and then the numerical value of input data to be provided as input ot the optimizer object to allow optimization without redoing most of the model creation process. This is basically what you were hoping to do in CVX, but can’t.

1 Like

Understood, thank you!