If-else statement

I have a problem with if-else statement which leads to “Disciplined convex programming error: Constraints may not appear in if/then statements.”
Could you please help to fix it? As recommend in community page, I checked big M Modelling as well as MIDCP. I still cannot understand how to solve the problem unfortunately.

variable V1x(length(t))
for i=1:length(t)

for i=1:length(t)
if Vs1(i)>=Vdd-Vtp
elseif V1x(i)>Vdd-Vdsatp(i)
else V1x(i)<=Vdd-Vdsatp(i)




Note: All parameters such as t,Vdd, Idsatp, Vdsatp, lambdap, Vtp, Rs, Vs1, Cm, and Cd are defined as constants before cvx_begin.

Look at the links on https://or.stackexchange.com/search?q=logic+modeling , and ask there for any assistance.

Thank you for your reply and the provided link. I checked it out and asked my question there, although I have not yet received any reply.
Could you please clarify if cvx has the capability to solve such a problem or you would recommend me to try other optimization method/tool?

Apparently your question https://or.stackexchange.com/questions/5282/if-else-statement-in-cvx was not well-received. I suggest rewriting it without reference to CVX, and inquire how to use Big M to handle the logic modeling. Describe your model mathematically, not as CVX code. f you show some effort, your question may be better received.

Did you look at the question and answers per the link I provided. I suggest you do that.

This should be doable in CVX provided you have Mosek or Gurobi available as a solver.