recover

Tags:

Updated:


recover create an sdpvar variable based on variable indicies

Syntax

x = recover(index)

Examples

sdpvar variables are built-up from internal variable indicies. An sdpvar variable can manually be recovered from an index

yalmip('clear')
x = sdpvar(1);
y = 5*x;
index = getvariables(y);
y - 5*recover(index)
ans =

     0

recover in combination with depends can for example conveniently be used to create a vector with all variables involved in a constraint

sdpvar x y z
Model = [x*y <= 1, z >= 0];
Used = recover(depends(Model));

Leave a Comment