Line | |
---|
1 | function x = true(x) |
---|
2 | % TRUE Constrains a variable to be positive |
---|
3 | % |
---|
4 | % TRUE(x) returns the constraint set(x>=1). |
---|
5 | % |
---|
6 | % For safety, it is advised to use the TRUE operator when working with |
---|
7 | % logic constraints, instead of relying on the automatic constraints used |
---|
8 | % by YALMIP (expression generated using AND and OR are automatically |
---|
9 | % assumed to be constrained to be true. |
---|
10 | % |
---|
11 | % SET(a|b) is automatically changed to SET(TRUE(a|b)), or equivalently |
---|
12 | % SET((a|b) >= 1), while SET(a) will be interpreted as SET(a>=0). To |
---|
13 | % constrain a to be true, the user has to explicitely use SET(TRUE(a)). |
---|
14 | % |
---|
15 | % See also SDPVAR/FALSE, SDPVAR/AND, SDPVAR/OR, SDPVAR/NOT, BINVAR, BINARY |
---|
16 | |
---|
17 | x = set(x>=1); |
---|
Note: See
TracBrowser
for help on using the repository browser.