The problem is not the difference, it’s assigning it to the vector W1. You can’t assign a CVX expression to a standard MATLAB vector. Have you declared that using an expression statement? i.e., expression W1(30)? Try that.
When I declare CD, CL, Wf, W1 all as expressions the model runs smoothly without any troubles but it won’t give me an output matrix for W1 it just spits out CVX expression. Is there a way around this to get W1 and V1 as matrices?
Actually, they should be output as matrices. I’m not sure why they are not. I don’t have a fix for you, unfortunately. You can submit a bug report to http://support.cvxr.com but I don’t know if I can fix it… you may have to recalculate these values.