x = optimvar(name)
x = optimvar(name, n, m, name, value)
| Parameter | Description |
|---|---|
| name | variable name. |
| n, m | variable dimensions. |
| name, value | variable properties such as LowerBound, UpperBound and Type. |
| Parameter | Description |
|---|---|
| x | optimization variable object. |
optimvar creates scalar or array variables used in problem-based expressions. Vector variables can be indexed with parentheses in expressions.
x = optimvar('x', 2, 1, 'LowerBound', 0);
expr = (x(1) - 1)^2 + (x(2) - 2)^2
| Version | Description |
|---|---|
| 2.0.0 | initial version |