recover

recover creates a variable from variable indicies.

Syntax

x = recover(index)

Examples

recover is essentially the inverse operator of getvariables

yalmip('clear')
x = sdpvar(1);
getvariables(x)

ans = 
    1

y = sdpvar(1);
getvariables(y)
ans = 
    2

z = x^2;
getvariables(z)
ans = 
    3
    
    
All = recover([1 2 3])

All - [x;y;x^2]

ans =

     0
     0
     0