Cramer is too slow.Try the following:A=[1 -1 0 0 0 1;0 1 -1 -1 0 0;0 0 0 1 -1 -1;10 10 4 0 0 0;0 0 -1 8 8 0;0 10 0 4 0 2];b=[0;0;0;-20;-20;-40];x=A\banswer is:x =0.33003-2.409240.19802-2.607260.13201-2.73927