A=[4,0,1,0;0,4,1,0;1,1,4,2;0,0,2,4];
A1=[(4-x(1)),0,1,0;0,(4-x(1)),1,0;1,1,(4-x(1)),2;0,0,2,(4-x(1))];
A2=[(4-x(2)),0,1,0;0,(4-x(2)),1,0;1,1,(4-x(2)),2;0,0,2,(4-x(2))];
A3=[(4-x(3)),0,1,0;0,(4-x(3)),1,0;1,1,(4-x(3)),2;0,0,2,(4-x(3))];
A4=[(4-x(4)),0,1,0;0,(4-x(4)),1,0;1,1,(4-x(4)),2;0,0,2,(4-x(4))];
A4\B
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 3.486855e-17.