recover creates an sdpvar variable based on variable indicies

### Syntax

x = recover(index)


### Examples

sdpvar expressions are internally represented by variable indicies (i.e., the only internal name is a number, see getvariables ). 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));