Question

In: Computer Science

x+ 2y−3z=−18 2x+ 6y−10z=−34 −x−4y+ (a+ 3)z=a2 You need to use MATLAB for this part: Open...

x+ 2y−3z=−18

2x+ 6y−10z=−34

−x−4y+ (a+ 3)z=a2

You need to use MATLAB for this part: Open a MATLAB session, create a script and save it under the name:yourfamilyname_yourfirstname_A_1.Do the following work in your script and save and publish it as a PDF, as shown in MATLAB Demo Part 2. You will need to include the published PDF of All the MATLAB work in your electronic submission in Canvas.

(a) For the system given in Question 1, let a= 5327. Create the corresponding augmented matrix in MATLAB.

(b) (2 Find the reduced row echelon form of the augmented matrix in MATLAB and read out the solutions from it.

(c) Create the coefficient matrix (i.e. Do Not include the right hand side constants) and call it A.

(d)Create a column vector of the right hand side and call it b.

(e) Use a the “ matrix left division” in MATLAB to solve the resulted linear system.(Hint: The backslash command,\, in MATLAB is what you need to use; either get help on\or get help on\ml divide).

Please provide a full solution for the question.

please also post a decent screen shot of the coding on matlab.

Solutions

Expert Solution

Code for the above question is given below

a=5327

A=[1 2 -3; 2 6 -10; -1 -4 a+3] %defining the matrix A.(part c)

b=[18 34 a^2]' % defining the solution matrix; I interpreted a2 as a2. ' in the end makes b a column vector. (part d)

Aaug=[A b] % part a, creating augmented matrix.

C = rref(Aaug) % creating a row echelon form, though solution is clearly visible still I have printed it using the command in next line

x = C(:,end) %from the matrix x=-5311, y=10661, z=5331

sol= A\b % A\b to get the solution.

Output

a =

5327


A =

1 2 -3
2 6 -10
-1 -4 5330


b =

18
34
28376929


Aaug =

1 2 -3 18
2 6 -10 34
-1 -4 5330 28376929


C =

1 0 0 -5311
0 1 0 10661
0 0 1 5331


x =

-5311
10661
5331


sol =

1.0e+04 *

-0.5311
1.0661
0.5331

We can see that rref and A\b gives same solution for x, y, z. Here 1.0e+04 is multiplied with all the 3 numbers and the sol is same as x.

Screen shots of the code with the o/ps are attached.


Related Solutions

find a 3x3 solution using substitution 5x-2y+3z=20 2x-4y-3z=-9 x+6y-8z=21
find a 3x3 solution using substitution 5x-2y+3z=20 2x-4y-3z=-9 x+6y-8z=21
Maximize z=x+4y Subject to 2x+6y<= 36 4x+2y<= 32 x>= 0 y>= 0 Maximum is ___________ at...
Maximize z=x+4y Subject to 2x+6y<= 36 4x+2y<= 32 x>= 0 y>= 0 Maximum is ___________ at x = ______ y = ______
Given two planes 3x − 2y + z = 1 and 2x + y − 3z = 3.
Given two planes 3x − 2y + z = 1 and 2x + y − 3z = 3. (a). Find the equation for the line that is the intersection of the two planes. (b). Find the equation for the plane that is perpendicular to the two planes.  
Solve by gaussian method x-y=-1 x-z=-6 6x-2y-3z=-18
Solve by gaussian method x-y=-1 x-z=-6 6x-2y-3z=-18
3. Solve the following system of equations. 5x- y+ z= -4 2x+ 2y-3z= -6 x-3y+ 2z=...
3. Solve the following system of equations. 5x- y+ z= -4 2x+ 2y-3z= -6 x-3y+ 2z= 0 Select the correct choice below: A. There is one solution. The solution is (     ). B. There are infinitely many solutions. The solutions (   ,z) C. There is no solution. 4. The total number of​ restaurant-purchased meals that the average person will eat in a​ restaurant, in a​ car, or at home in a year is 150. The total number of these meals...
Consider a system of linear equations: x−y + 3z + u = 3 2x−2y + 7z...
Consider a system of linear equations: x−y + 3z + u = 3 2x−2y + 7z + u = 2 x−y + 2z + u = 1 1. Write down the augmented matrix of the system, and take this matrix to the reduced row echelon form. 2. Determine the leading and the free variables of the system, and write down its general solution.
2. Given the System of Equations: 3x+2y+z+20w= 6 x+2y+z+10w=0 x+y+z+6w=2 2x+2y+z+15w=3 a) Use your calculator to...
2. Given the System of Equations: 3x+2y+z+20w= 6 x+2y+z+10w=0 x+y+z+6w=2 2x+2y+z+15w=3 a) Use your calculator to solve, leaving solution in parametric form b) Find the specific solution when y = 6 c) Perform, BY HAND, a full check of this particular solution
find the general solution 2xy^3+e^x+(3x^2y^2+siny)y'=0 xy'=6y+12x^4y^(2/3) (2x+1)y'+y=(2x+1)^(3/2)
find the general solution 2xy^3+e^x+(3x^2y^2+siny)y'=0 xy'=6y+12x^4y^(2/3) (2x+1)y'+y=(2x+1)^(3/2)
Use MATLAB to solve the following problem: x - 3y = 2 x + 5y = 18 4x - 6y = 20
Use MATLAB to solve the following problem:x - 3y = 2x + 5y = 184x - 6y = 20  
Solve for x,y,z using the inverse if possible. x+2y+5z=2 2x+3y+8z=3 -x+y+2z=3
Solve for x,y,z using the inverse if possible. x+2y+5z=2 2x+3y+8z=3 -x+y+2z=3
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT