A given system of linear equations Ax = b can be solved using Gaussian elimination. For the following A's and b's, perform as indicated: Problem 1: () »-) 1 2 A1 =4 2 8 xv1= b1 = 12 4 4 Problem 2: 2 4 3 0 3 0 3 5 /2 A2 = xv2= b= 0 2 1 Script e A Save C Reset MATLAB Documentation 1 %Encode A1, b1 and x1 as the vector of unknowns. 2 A1 = 3 b1 = 4 syms 5 xv1 = 6 7 %Check the size of A, set it as m1 and n1 8 [m1,n1] = 9 10 %Augment A and b to form AM1 11 AM1 = 12 13 %Solve the Reduced Rwo Echelon of AM1. 14 RREFA1 = 15 16 %Collect the last column and set as bnew1, set the remaining elements as Anew1 17 bnew1= 18 Anew1 = 19 20 %Check if Anew is an identity matrix, if it is, bnew is the solution 21 if Anew1 =eye(m1,n1) 22 Root1 = bnew1 23 else 24 display("No Solution") 25 end 26

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
A given system of linear equations Ax = b can be solved using Gaussian elimination. For the following A's and b's, perform as indicated:
Problem 1:
(3 1 2
A1 = 4 2 8
2 4 4.
xv1= y
b1 = 1
Problem 2:
12 1
2 3
3
4
x1
x2
Xv2=
x3
A2 =
b=
0 3
3
0 2 1
-4.
x4
Script e
H Save
C Reset
I MATLAB Documentation
1 %Encode A1, b1 and x1 as the vector of unknowns.
2 A1 =
3 b1 =
4 syms
5 xv1 =
6
7 %Check the size of A, set it as m1 and n1
8 [m1, n1] -
9
10 %Augment A and b to form AM1
11 AM1 =
12
13 %Solve the Reduced Rwo Echelon of AM1.
14 RREFA1 =
15
16 %Collect the last column and set as bnew1, set the remaining elements as Anew1
17 bnew1=
18 Anew1 =
19
20 %Check if Anew is an identity matrix, if it is, bnew is the solution
21 if Anew1 =eye(m1, n1)
22
Root1 - bnew1
23 else
24
display("No Solution")
25 end
26
Transcribed Image Text:A given system of linear equations Ax = b can be solved using Gaussian elimination. For the following A's and b's, perform as indicated: Problem 1: (3 1 2 A1 = 4 2 8 2 4 4. xv1= y b1 = 1 Problem 2: 12 1 2 3 3 4 x1 x2 Xv2= x3 A2 = b= 0 3 3 0 2 1 -4. x4 Script e H Save C Reset I MATLAB Documentation 1 %Encode A1, b1 and x1 as the vector of unknowns. 2 A1 = 3 b1 = 4 syms 5 xv1 = 6 7 %Check the size of A, set it as m1 and n1 8 [m1, n1] - 9 10 %Augment A and b to form AM1 11 AM1 = 12 13 %Solve the Reduced Rwo Echelon of AM1. 14 RREFA1 = 15 16 %Collect the last column and set as bnew1, set the remaining elements as Anew1 17 bnew1= 18 Anew1 = 19 20 %Check if Anew is an identity matrix, if it is, bnew is the solution 21 if Anew1 =eye(m1, n1) 22 Root1 - bnew1 23 else 24 display("No Solution") 25 end 26
| 27 | %Augment the matrix A1 with the identity Matrix of the same size, set the result as AMI1
28 AMI1 =
29 %Find the reduced row echelon form of AMI1, set the result as RREFAI1
30 RREFAI1=
31 %Collect the second half of the matrix as AInew1, set the remaining elements as AIold1
32 AInew1=
33 AIold1 в
34
35 %Check if AIold1 is an identity matrix, if it is, AInew1 is the inverse
36
37
38 %Encode A2, b2 and xv2 as the vector of unknowns.
39 A2 =
40 b2 =
41 syms
42 xv2 =
43
44 %Check the size of A2, set it as m2 and n2
45 [m2, n2] =
46
47 %Augment A2 and b2 to form AM2
48 AM2 =
49
50 %Solve the Reduced Rwo Echelon of AM2.
51 RREFA2 =
52
53 %Collect the last column and set as bnew2, set the remaining elements as Anew2
54 bnew2=
55 Anew2 =
56
57 %Check if Anew is an identity matrix, if it is, bnew2 is the solution
58 if Anew1 -eye (m2, n2)
59
Root2 = bnew2
60 else
display ("No Solution")
61
62 end
63
64 %Augment the matrix A2 with the identity Matrix of the same size, set the result as AMI2
65 AMI2 =
66 %Find the reduced row echelon form of AMI2, set the result as RREFAI2
67 RREFAI2=
68 %Collect the second half of the matrix as AInew2, set the remaining elements as AIold2
69 AInew2=
70 AIold2 -
71
72 %Check if AIold2 is an identity matrix, if it is. AInew2 is the inverse
Transcribed Image Text:| 27 | %Augment the matrix A1 with the identity Matrix of the same size, set the result as AMI1 28 AMI1 = 29 %Find the reduced row echelon form of AMI1, set the result as RREFAI1 30 RREFAI1= 31 %Collect the second half of the matrix as AInew1, set the remaining elements as AIold1 32 AInew1= 33 AIold1 в 34 35 %Check if AIold1 is an identity matrix, if it is, AInew1 is the inverse 36 37 38 %Encode A2, b2 and xv2 as the vector of unknowns. 39 A2 = 40 b2 = 41 syms 42 xv2 = 43 44 %Check the size of A2, set it as m2 and n2 45 [m2, n2] = 46 47 %Augment A2 and b2 to form AM2 48 AM2 = 49 50 %Solve the Reduced Rwo Echelon of AM2. 51 RREFA2 = 52 53 %Collect the last column and set as bnew2, set the remaining elements as Anew2 54 bnew2= 55 Anew2 = 56 57 %Check if Anew is an identity matrix, if it is, bnew2 is the solution 58 if Anew1 -eye (m2, n2) 59 Root2 = bnew2 60 else display ("No Solution") 61 62 end 63 64 %Augment the matrix A2 with the identity Matrix of the same size, set the result as AMI2 65 AMI2 = 66 %Find the reduced row echelon form of AMI2, set the result as RREFAI2 67 RREFAI2= 68 %Collect the second half of the matrix as AInew2, set the remaining elements as AIold2 69 AInew2= 70 AIold2 - 71 72 %Check if AIold2 is an identity matrix, if it is. AInew2 is the inverse
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY