Reuse solution of variables

is there a way to store the optimization solution of the variables in-order to reuse them with CVX
also how to store the objective function solution
for example, I doing something like this
variable CtC(24)
maximize( totcost );
subject to
for n=1:24

eUtC(n+1)=UtC(n,1); solution of variable Utc

I don’t know what you mean by “reuse them with CVX”. CVX does not accept starting values of variables declared in CVX. But you can “use” then however you want in MATLAB.

After successful completion of CVX, cvx_optval is just a numerically populated MATLAB variable, and what were the CVX variables are numerically populated MATLAB variables. You can save these into other MATLAB variables, including arrays, if you wish to retain them for future use and not lose them if your CVX program is re-run. For example, see How to use looping in CVX tool , and you can do similarly with CVX optimal variable values.