```
clear all
clc
% Generate data
dbar=[0 41 5;41 0 0;5 0 0];
w=[0 1 1;1 0 0;1 0 0]; %%%% mask Matrix
one=ones(3,1);
% Create and solve problem
cvx_begin
variable G(3,3)
minimize (norm(dbar - (w.*(diag(G)*one'- 2*G + one*diag(G)')),'fro'))
subject to
G >= 0;
G*one == 0;
cvx_end
```

Output

G =

1.0e-09 *

```
0.4323 0.3402 0.3746
0.3384 0.4283 0.3786
0.3704 0.3760 0.3802
```

value of G is too small i am confuse is cvx is working correctly or not?