Variable for optimization
An OptimizationVariable
object contains variables for
optimization expressions. These expressions represent the objective function or
constraints. Variables are symbolic in nature, and can be arrays of any
size.
Create an OptimizationVariable
object using optimvar
.
showbounds | Display variable bounds |
showvar | Display optimization variable |
writebounds | Save description of variable bounds |
writevar | Save optimization variable description |
OptimizationVariable
objects have handle copy
behavior. See Handle Object Behavior (MATLAB) and Comparison of Handle and Value Classes (MATLAB). Handle copy behavior means that a copy of an OptimizationVariable
points to the original and does not have an independent existence. For example, create a
variable x
, copy it to y
, then set a property of
y
. Note that x
takes on the new property
value.
x = optimvar('x','LowerBound',1); y = x; y.LowerBound = 0; showbounds(x)
0 <= x