value

Updated:


value is used to extract the numerical value of a decision variable.

Syntax

Y = value(X)

Examples

After solving an optimization problem we can extract any value of an expression containing decision variables

x = sdpvar(2,1);
F = [-1 <= x <= 1];
obj = x'*x + sum(x);
optimize(F,obj);
optobj = value(obj)
optx = value(x)