Hello there,
I solved many SDPs with YALMIP and wanted to solve the same SDPs now with CVX.
The problem is that all obtained solutions from CVX differ from the YALMIP-solutions which are known to be correct. Also with CVXPY I obtain the same solution as in YALMIP.
After realizing this I tried to solve a very simple SDP with CVX and YALMIP with the same solver (here sedumi) to compare the solutions. As before the YALMIP-solution is correct and the CVX-solution is not.
Here is the code for this program:

%-----------------------------------------------------------------
clear all
format long g
B=[1 0 0 0.5 0 0; 0 0 0 -0.5 -1 0; 0 0 0.5 0 0 1; 0 0 0.5 0 1 0];
f=[0; -10; 0; 0];
E=100;
cvx_begin % sdp
cvx_solver sedumi
variables w t(6,1)
min(w);
subject to
% [w f'; f E*B*diag(t)*B'] >=0;
[w f'; f E*B*diag(t)*B']==semidefinite(5)
sum(t)<=1
t>=0
cvx_precision high
cvx_end
t
% Now with YALMIP
clear w t
sdpvar w;
t=sdpvar(6,1);
Model = [[w f';f E*B*diag(t)*B'] >= 0,
sum(t)<=1,
t>=0];
ops = sdpsettings('solver','sedumi');
sol = optimize(Model,w,ops);
value(t)
%-----------------------------------------------------------------

I already changed the solver-precision, tried other versions of CVX, etc. without an effect.
I am very confused, what am I doing wrong?

You need minimize(w) . The expression min(w) is just the minimum of the elements of w, and because it is a scalar, that minimum is w, and if not terminated with ; would print out that it is cvx real affine expression (scalar). it does nothing, because it is just hanging in the program by itself.

So your CVX program solves a feasibility problem, because it has no minimize or maximize statement. Therefore any feasible solution is “optimal”. What you did is equivalent to sol = optimize(Model,[],ops); in YALMIP.

Leave cvx_precision at default; Nothing good with come of changing to high, and some bad stuff might happen. The collective wisdom of this forum supersedes the CVX Users’ Guide on this matter.

Although this didn’t come up in your program, one notable difference between CVX and YALMIP is that square matrices are full by default in CVX, whereas they are symmetric by default in YALMIP. If you declare a square matrix in CVX, but don’t declare it as symmetric (or hermitian), and then use it in a diagonal block of an SDP constraint, it won’t work correctly, and should result in a warning message about being non-symmetric. The other big difference, as you apparently have already discovered, is that YALMIP is always in what is essentially CVX’s sdp mode.

As for version of CVX, stick with 2.2. Do not use any other version.