Don’t declare the weights which you want to hold constant as CVX variables, and just set them to whatever value you want as MATLAB variables.
If that is too difficult, add constraints to constrain them to the desired values.
w(2) == 3.7
w(5) == 2.1
If that doesn’t amswer your question, then please provide code allowing for more specific guidance.