Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

erview plete the implementation of the linSys_1 function, which solves a system

ID: 3710895 • Letter: E

Question

erview plete the implementation of the linSys_1 function, which solves a system of simultaneous linear equations e function should return a vector x which is the solution of the system of equations below. -4.93 x1 + -4.4 x2 +-4.88 x3 + 1.9 x4 = 5.43 -1.23 x1+3.54 x2+ 5.26 x3+ 2.27 x40.67 7.23 x1 + 5.04 x2 +-2.27 x3 8.4 x4 = ?.79 8.13 x +-9.23 x2 + -3.61 x3 +-7.62 x45.76 Input variable n/a - This function has no input variables. Create your own variables to represent the system of equations within the function. tput variables: x- A vector containing the solution of the system of equations listed above. Function Template unction xlinSys_1() ints: 1. For information on how to solve a system of equations, please refer to section 9.11 of the Introduction to Programming in MATLAB document on Blackboard Submitted file function x - linsys _1() end

Explanation / Answer

syms x1 x2 x3 x4
eqn1 = 2*x1 + x2 + x3 +x4== 2;
eqn2 = -x1 + x2 - x3+x4 == 3;
eqn3 = x1 + 2*x2 + 3*x3+x4 == -10;
eqn4 = x1+x2+x3+x4==50;
[A,B] = equationsToMatrix([eqn1, eqn2, eqn3,eqn4], [x1, x2, x3,x4]);
sol = solve([eqn1, eqn2, eqn3 ,eqn4], [x1, x2, x3, x4]);
sol.x1
sol.x2
sol.x3
sol.x4