For/end loop in cvx tool box

Uncategorized
Sep 8, 2022
Z

i have ten iterations to execute, and i want to use new power for every iteration, i.e for iteration 1 P1, for iteration 2 P2, … iteration 10 P10.
plz guide me how to use
zaheer

M

You need to describe more clearly what you are trying to do, and what aspect you don’t know how to code.

Do you want a structure similar to this?

for i=1:10
  cvx_begin
  variable x
  minimize(x^i)
  % constraints
  cvx_end
end

Or are Pi power levels which are input data? If so, have cvx_begin ... cvx _end inside for ... end and use P(i) in the CVX portion.

Z
Replying to #2

thanks for dear M.L Stone for your kind reply and early response. i have done and fix my problem.
i have learnt many things from this forum through many previous problems solutions.
once again very very thanks. i,ll remain in contact with this forum in future.

Zaheer