sdpvar x1 x2;
p = 2*x1^4+3*x1^2*x2^2+2*x1*x2^3+4*x2^4;
z = [x1^2 x1*x2 x2^2]';
S = sdpvar(length(z));
Fs0 = set(coefficients(p-z'*S*z,[x1,x2])==0);
solvesdp(Fs0);
Sv = double(S);
U = sdpvar(length(z));
Fs = set(Sv+U>=0)+set(coefficients(z'*U*z,[x1,x2])==0);
solvesdp(Fs)