Constraint modeling, Illegal use of "for" #1429
-
Hello, How can I model the following constraint in YALMIP? sub(i,j,c)-s(i,c) <= 0; for all i,j,c I examined the following code but it is not true (obj is not important) and I get the error "Illegal use of reserved keyword "for"": clc I=40;J=40;C=15; s=sdpvar(I,C); con=[for k=1:J Cost=value(obj) How can I add the mentioned constraint to my optimization model? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
just use a for-loop like normal, final example here for instance https://yalmip.github.io/tutorial/basics/ |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your help. This example guides me to what I want. |
Beta Was this translation helpful? Give feedback.
just use a for-loop like normal, final example here for instance https://yalmip.github.io/tutorial/basics/