problem.yy = sdpvar(params.n, 1, 'full');
X = problem.X;
yy = problem.yy;
A1 = problem.P{1};
A2 = problem.Q{1} * X;
[a,b] = size(A1);
one = ones(a,1);
sp1 = one' * A1 * (one + yy)/2;
sp2 = one' * A2 * (one + yy)/2;
sm1 = one' * A1 * (one - yy)/2;
sm2 = one' * A2 * (one - yy)/2;
s1 = one' * A1 * one;
s2 = one' * A2 * one;
gamma = yy * yy';
d1 = A1 * one;
d2 = A2 * one;
D1 = diag(d1);
D2 = diag(d2);
p1 = 4*sp1*sm1 / (s1*s1);
p2 = 4*sp2*sm2 / (s2*s2);
obj = 1/p1 * trace(gamma*((D1-A1)/s1)) + 1/p2 * trace(gamma*((D2-A2)/s2));
%(gamma >= 0) don't think I need this constraint, as y*y' has entries >= 0
constraints = [ (diag(gamma)== one) 1/(s1*s1)*trace(gamma * d1 * d1') == 1-p1 ...
1/(s2*s2)*trace(gamma* d2 * d2') == 1-p2 p1>0 p1<=1 p2>0 p2<=1];
My problem now is, that I get the following warning: Warning: Solver not applicable (mosek does not support semidefinite constraints)
Could you please help me understand, what I did wrong, to produce this warning? 
It also looks like you've misunderstood the whole idea with a semidefinite relaxation, as you introduce a quadratic inner product yy'. The idea in (lowest-order) semidefinite relaxations is that you express the model in yy' and then replace that with a matrix Y with the constraint that Y >=0 and Y has rank 1, and then you drop the rank constraint.
In your case, it means you want gamma = sdpvar(params.n) and gamma >=0
As you have it now, you have a nonlinear nonconvex semidefinite program, much harder than the original nonconvex quadratic program you probably started with
Not sure what you mean with full relaxation, as what you did was not a relaxation at all, but good that it was fixed.
Note also that all these things can be done automatically for you with the moment relaxation framework