getbasis

getbasis returns numerical basis with respect to specified variables

Syntax

B = getbasis(p,index)

Examples

sdpvar variables are built-up from internal variables multiplied with numerical data. The full numerical basis is extracted using getbase

yalmip('clear')
x = sdpvar(1);
y = sdpvar(1);
p = 2 + 3*x + 4*y;
full(getbase(p))
ans = 
    2 3 4

To extract only certain bases, we list the variable indicies, extracted using getvariables

yalmip('clear')
x = sdpvar(1);
y = sdpvar(1);
z = sdpvar(1);

p = 2 + 3*x + 4*y +5*z;
full(getbasis(p,getvariables([x z])))
ans = 
    4 5