x = optimvar(name)
x = optimvar(name, n, m, Name, Value)
| Parameter | Description |
|---|---|
| name | variable name used in generated expressions and solution structures. |
| n, m | optional dimensions for vector or matrix variables. |
| Name, Value | variable properties such as LowerBound, UpperBound, and Type. |
| Parameter | Description |
|---|---|
| x | optimization variable object. |
optim.problemdef.OptimizationVariable represents scalar or array variables used to build optimization expressions.
Create variables with optimvar, then combine them into objectives and constraints.
x = optimvar('x', 2, 1, 'LowerBound', 0);
expr = (x(1) - 1)^2 + (x(2) - 2)^2
| Version | Description |
|---|---|
| 2.0.0 | initial version |