I didn’t check whether your model makes sense. But I did run it with multiple solvers, and the optimal solution satisfied constraints within tolerance. You have no guarantee the constraints will be exactly satisfied. For instance x(1,1) = -6.3912e-09 is within allowable tolerance of being nonnegative. In fact, the exact optimal x(1,:) = zeros(15,1) corresponding to your “solution”. However, your model is rather degenerate and has multiple optimal solutions all achieving the optimal objective value of -104.

If you have a solution which has a constraint violation of more than 1e-8, please show us the output and the amount of the constraint violation.

Thanks for the reply. x(1, 1) = -6.3912e-09 is not a problem. But, the issue is it is not satisfying the following constraints (extracted from the full code above):

y == sum(x, 2);
y(1) == initialWealth;
for i=1:floor(nodes/4)
%if 2 * i <= floor(nodes/2)
randomReturn(1, : ) * transpose(x(i)) - y(2 * i) == 0;
randomReturn(2, : ) * transpose(x(i)) == y(2 * i + 1);
%end
end

The first line says y(i) = x(i, 1) + x(i, 2) for all i = 1, 2, …, 15.
Now, y(1) = x(1, 1) + x(1, 2) = 60 (initial wealth). This constraint is satisfied.
In the for loop when i = 1, the constraint becomes as follows after putting the value of variables:
1.25 * x(1, 1) + 1.14 * x(1, 2) = y(2) = x(2, 1) + x(2, 2). But, this constraint is not satisfied since 1.14 * 60 != -7.28 * 10 ^(-9).
My variable x is solved (also mentioned above) as follows: http://ask.cvxr.com/uploads/default/original/1X/5c94ba52244e9801e68eff25bd3aae3296b6064a.png

Also, other constraints in the loop are also not satisfied.

CVX solved what you input. It appears that you forgot to use double subscripts for x. For instance, you want x(ii,1) and x(i,2), but only use x(i), which will go through elements of x by 1st column, 2nd column, etc.