%%Solve System of Linear Equations Using solve %Dejen Ketema April 2019 %Example 1 % 2*x+y+z=2 % -x+y-z=3 % x+2*y+3*z=-10 % Declare the system of equations. syms x y z eqn1 = 2*x + y + z == 2; eqn2 = -x + y - z == 3; eqn3 = x + 2*y + 3*z == -10; %Solve the system of equations using solve. %The inputs to solve are a vector of equations, and a vector of variables to solve the equations for. sol = solve([eqn1, eqn2, eqn3], [x, y, z]); x = sol.x; y = sol.y; z= sol.z; st=[x y z];