2w-x+5y+z=-3
3w+2x+2y-6z=-32
w+3x+3y-z=-47
5w-2x-3y+3z=49
w,x
y,z
clc;clear all
%%The given code solves for w,x,y and z using left division
operator
%%Matrix A has the coefficients of the variables w,x,y and x
%%Matrix B has the RHS vector
%%Matrix X finds the solution
%%Output is printed as desired
A=[2 -1 5 1;3 2 2 -6;1 3 3 -1;5 -2 -3 3];
B=[-3;-32;-47;49];
X=A\B;
fprintf('Value of w is: %5.3f . Value of x is: %5.3f \n. Value of y
is: %5.3f . Value of z is %5.3f',X(1),X(2),X(3),X(4))
Get Answers For Free
Most questions answered within 1 hours.