際際滷

際際滷Share a Scribd company logo
www.engineeringwithsandeep.com| Student Assignment
Assignment No. 04
Solve the set of linear equations
04.04.2021
Shivam Choubey
Student No: CFDB30321004
www.engineeringwithsandeep.com| Student Assignment
Gauss Elimination
% solve Gauss elimination method consider
% 2a+2b-c+d=4
% 4a+3b-c+2d=6
% 8a+5b-3c+4d=12
%3a+3b-2c+2d=6
% checking A^-1*b
A=[2 2 -1 1;4 3 -1 2;8 5 -3 4;3 3 -2 2];
b=[4 6 12 6]';
[n, n] = size(A);
[n, k] = size(b);
x = zeros(n,k); %%initial value
for i = 1:n-1
m = -A(i+1:n,i)/A(i,i);
A(i+1:n,:) = A(i+1:n,:) + m*A(i,:);
b(i+1:n,:) = b(i+1:n,:) + m*b(i,:);
end;
disp("Matrix before back substitution ")
A
% Use back substitution to find unknowns
x(n,:) = b(n,:)/A(n,n);
for i = n-1:-1:1
x(i,:) = (b(i,:) -
A(i,i+1:n)*x(i+1:n,:))/A(i,i);
end
disp("Value of a ,b ,c & d ")
x
disp("Checking result")
disp("inverse of A")
val=inv(A)
disp("Value of a,b,c &d ")
val*b
Ouput
>> Gauss
Matrix before back substitution
A =
2.0000 2.0000 -1.0000 1.0000
0 -1.0000 1.0000 0
0 0 -2.0000 0
0 0 0 0.5000
Value of a ,b ,c & d
x =
1
1
-1
-1
Checking result
inverse of A
val =
0.5000 1.0000 0.2500 -1.0000
0 -1.0000 -0.5000 0
0 0 -0.5000 0
0 0 0 2.0000
Value of a,b,c &d
ans =
1
1
-1
-1
www.engineeringwithsandeep.com| Student Assignment
Gauss Jordan Method
function [x,err]=gauss_jordan_elim(A,b)
A=[2 2 -1 1;4 3 -1 2;8 5 -3 4;3 3 -2 2];
b=[4 6 12 6]';
[n,m]=size(A);
Aa=[A,b];
for i=1:n
[Aa(i:n,i:n+1),err]=gauss_pivot(Aa(i:n,i:n+1));
if err == 0
Aa(1:n,i:n+1)=gauss_jordan_step(Aa(1:n,i:n+1),i);
end
end
x=Aa(:,n+1);
A=0;
www.engineeringwithsandeep.com| Student Assignment
Continue code
function A1=gauss_jordan_step(A,i)
[n,m]=size(A);
A1=A;
s=A1(i,1);
A1(i,:) = A(i,:)/s;
k=[[1:i-1],[i+1:n]];
for j=k
s=A1(j,1);
A1(j,:)=A1(j,:)-A1(i,:)*s;
end % end of for loop
function [A1,err]=gauss_pivot(A)
[n,m]=size(A);
A1=A;
err = 0;
if A1(1,1) == 0
check = logical(1);
i = 1;
end
gauss_jordon
ans =
1
1
-1
-1
Checking
inv(A)
ans =
1.0000 -0.5000 0.5000 -1.0000
1.0000 0.5000 -0.5000 0
-1.0000 1.5000 -0.5000 0
-4.0000 1.5000 -0.5000 2.0000
>> inv(A)*b
ans =
1
1
-1
-1
Ad

Recommended

Teor鱈a y problemas de Sumas Notables II sn26 ccesa007
Teor鱈a y problemas de Sumas Notables II sn26 ccesa007
Demetrio Ccesa Rayme
How to factor powerpoint
How to factor powerpoint
MarcusGuyton
Aval expres
Aval expres
Elisane Della Costa
3.9.1 Dilation, Scale Factor, and Proportion
3.9.1 Dilation, Scale Factor, and Proportion
smiller5
Per6 basis_Representations Of Integers
Per6 basis_Representations Of Integers
Evert Sandye Taasiringan
Practica productos notables
Practica productos notables
Lina Ari
Habilidad operativa
Habilidad operativa
Wilson Avalos
7th PreAlg - L55--Feb3
7th PreAlg - L55--Feb3
jdurst65
Algebra 7 Point 5
Algebra 7 Point 5
herbison
No factorization,no complex methods -Simplest method to solve quadratic equa...
No factorization,no complex methods -Simplest method to solve quadratic equa...
FabMarks
Ch02 22
Ch02 22
schibu20
Germany population keynote
Germany population keynote
Evan Franz
Derivadas ( jesus crespo)
Derivadas ( jesus crespo)
jesusacb
1.2 expansion and factorization
1.2 expansion and factorization
MARA
Calculo mental 2019 5 to1
Calculo mental 2019 5 to1
Claudia Gutierrez
How to check if your multiplication is correct
How to check if your multiplication is correct
Srikanth KS
Productos notables
Productos notables
PROFTEBA
Ninth grade 4th period study guide key
Ninth grade 4th period study guide key
Joshua Gerrard
Math basic
Math basic
ERUMSULAYMAN1
CM1.4 Algorithms, python and SAGE
CM1.4 Algorithms, python and SAGE
A Jorge Garcia
Lista plant達o 05 - 7尊 ano
Lista plant達o 05 - 7尊 ano
Prof. Materaldo
Lista plant達o 04 - 7尊 ano
Lista plant達o 04 - 7尊 ano
Prof. Materaldo
Proofs day 2
Proofs day 2
jbianco9910
Mate factorizaci坦n por binomio - 2尊
Mate factorizaci坦n por binomio - 2尊
brisagaela29
C2 mate factorizaci坦n por binomio - 5尊
C2 mate factorizaci坦n por binomio - 5尊
brisagaela29
2 punto medio
2 punto medio
Jessica Sanchez Quispe
Real Numbers
Real Numbers
arunavabera
Matematicas para ingenieria 4ta edicion - john bird
Matematicas para ingenieria 4ta edicion - john bird
Allan Bernal Espinoza
Matrices 44.4
Matrices 44.4
Kimguan Tan
Diagnostic_Exam_Grade_7_Mathematics.docx
Diagnostic_Exam_Grade_7_Mathematics.docx
IWa Suguitan

More Related Content

What's hot (19)

Algebra 7 Point 5
Algebra 7 Point 5
herbison
No factorization,no complex methods -Simplest method to solve quadratic equa...
No factorization,no complex methods -Simplest method to solve quadratic equa...
FabMarks
Ch02 22
Ch02 22
schibu20
Germany population keynote
Germany population keynote
Evan Franz
Derivadas ( jesus crespo)
Derivadas ( jesus crespo)
jesusacb
1.2 expansion and factorization
1.2 expansion and factorization
MARA
Calculo mental 2019 5 to1
Calculo mental 2019 5 to1
Claudia Gutierrez
How to check if your multiplication is correct
How to check if your multiplication is correct
Srikanth KS
Productos notables
Productos notables
PROFTEBA
Ninth grade 4th period study guide key
Ninth grade 4th period study guide key
Joshua Gerrard
Math basic
Math basic
ERUMSULAYMAN1
CM1.4 Algorithms, python and SAGE
CM1.4 Algorithms, python and SAGE
A Jorge Garcia
Lista plant達o 05 - 7尊 ano
Lista plant達o 05 - 7尊 ano
Prof. Materaldo
Lista plant達o 04 - 7尊 ano
Lista plant達o 04 - 7尊 ano
Prof. Materaldo
Proofs day 2
Proofs day 2
jbianco9910
Mate factorizaci坦n por binomio - 2尊
Mate factorizaci坦n por binomio - 2尊
brisagaela29
C2 mate factorizaci坦n por binomio - 5尊
C2 mate factorizaci坦n por binomio - 5尊
brisagaela29
2 punto medio
2 punto medio
Jessica Sanchez Quispe
Real Numbers
Real Numbers
arunavabera
Algebra 7 Point 5
Algebra 7 Point 5
herbison
No factorization,no complex methods -Simplest method to solve quadratic equa...
No factorization,no complex methods -Simplest method to solve quadratic equa...
FabMarks
Ch02 22
Ch02 22
schibu20
Germany population keynote
Germany population keynote
Evan Franz
Derivadas ( jesus crespo)
Derivadas ( jesus crespo)
jesusacb
1.2 expansion and factorization
1.2 expansion and factorization
MARA
Calculo mental 2019 5 to1
Calculo mental 2019 5 to1
Claudia Gutierrez
How to check if your multiplication is correct
How to check if your multiplication is correct
Srikanth KS
Productos notables
Productos notables
PROFTEBA
Ninth grade 4th period study guide key
Ninth grade 4th period study guide key
Joshua Gerrard
CM1.4 Algorithms, python and SAGE
CM1.4 Algorithms, python and SAGE
A Jorge Garcia
Lista plant達o 05 - 7尊 ano
Lista plant達o 05 - 7尊 ano
Prof. Materaldo
Lista plant達o 04 - 7尊 ano
Lista plant達o 04 - 7尊 ano
Prof. Materaldo
Mate factorizaci坦n por binomio - 2尊
Mate factorizaci坦n por binomio - 2尊
brisagaela29
C2 mate factorizaci坦n por binomio - 5尊
C2 mate factorizaci坦n por binomio - 5尊
brisagaela29

Similar to Solve the set of linear equations (20)

Matematicas para ingenieria 4ta edicion - john bird
Matematicas para ingenieria 4ta edicion - john bird
Allan Bernal Espinoza
Matrices 44.4
Matrices 44.4
Kimguan Tan
Diagnostic_Exam_Grade_7_Mathematics.docx
Diagnostic_Exam_Grade_7_Mathematics.docx
IWa Suguitan
Final exam g8 correction
Final exam g8 correction
zeinabze
Sesion de aprendizaje de ecuacion de primer grado algebra pre universitaria c...
Sesion de aprendizaje de ecuacion de primer grado algebra pre universitaria c...
Demetrio Ccesa Rayme
Vector Algebra One Shot #BounceBack.pdf
Vector Algebra One Shot #BounceBack.pdf
vaibahvgoel3620
Dynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain Multiplication
KrishnakoumarC
Algebra 1 week 10 learn it
Algebra 1 week 10 learn it
JessicaBiemiller
Solution of matlab chapter 1
Solution of matlab chapter 1
AhsanIrshad8
College Algebra and Trigonometry 6th Edition Lial Solutions Manual
College Algebra and Trigonometry 6th Edition Lial Solutions Manual
kulhapjaymijp
Sect3 7
Sect3 7
inKFUPM
Bca3010 computer oriented numerical methods
Bca3010 computer oriented numerical methods
smumbahelp
Sesi坦n de Aprendizaje : Ecuaci坦n de primer grado Algebra pre-universitaria c...
Sesi坦n de Aprendizaje : Ecuaci坦n de primer grado Algebra pre-universitaria c...
Demetrio Ccesa Rayme
Sesi坦n de Aprendizaje Ecuaci坦n de Primer Grado Algebra pre-universitaria cc...
Sesi坦n de Aprendizaje Ecuaci坦n de Primer Grado Algebra pre-universitaria cc...
Demetrio Ccesa Rayme
Soal tiu tes cpns 2019 part 1
Soal tiu tes cpns 2019 part 1
Erwin Siahaan
Chapter 6 algebraic expressions iii
Chapter 6 algebraic expressions iii
Khusaini Majid
Tugas mtk 1.01
Tugas mtk 1.01
arehansanada
Solucionario c.t. 叩lgebra 5属
Solucionario c.t. 叩lgebra 5属
Edward Quispe Mu単oz
ikh323-05
ikh323-05
Anung Ariwibowo
solving quadratic equations using quadratic formula
solving quadratic equations using quadratic formula
maricel mas
Matematicas para ingenieria 4ta edicion - john bird
Matematicas para ingenieria 4ta edicion - john bird
Allan Bernal Espinoza
Matrices 44.4
Matrices 44.4
Kimguan Tan
Diagnostic_Exam_Grade_7_Mathematics.docx
Diagnostic_Exam_Grade_7_Mathematics.docx
IWa Suguitan
Final exam g8 correction
Final exam g8 correction
zeinabze
Sesion de aprendizaje de ecuacion de primer grado algebra pre universitaria c...
Sesion de aprendizaje de ecuacion de primer grado algebra pre universitaria c...
Demetrio Ccesa Rayme
Vector Algebra One Shot #BounceBack.pdf
Vector Algebra One Shot #BounceBack.pdf
vaibahvgoel3620
Dynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain Multiplication
KrishnakoumarC
Algebra 1 week 10 learn it
Algebra 1 week 10 learn it
JessicaBiemiller
Solution of matlab chapter 1
Solution of matlab chapter 1
AhsanIrshad8
College Algebra and Trigonometry 6th Edition Lial Solutions Manual
College Algebra and Trigonometry 6th Edition Lial Solutions Manual
kulhapjaymijp
Sect3 7
Sect3 7
inKFUPM
Bca3010 computer oriented numerical methods
Bca3010 computer oriented numerical methods
smumbahelp
Sesi坦n de Aprendizaje : Ecuaci坦n de primer grado Algebra pre-universitaria c...
Sesi坦n de Aprendizaje : Ecuaci坦n de primer grado Algebra pre-universitaria c...
Demetrio Ccesa Rayme
Sesi坦n de Aprendizaje Ecuaci坦n de Primer Grado Algebra pre-universitaria cc...
Sesi坦n de Aprendizaje Ecuaci坦n de Primer Grado Algebra pre-universitaria cc...
Demetrio Ccesa Rayme
Soal tiu tes cpns 2019 part 1
Soal tiu tes cpns 2019 part 1
Erwin Siahaan
Chapter 6 algebraic expressions iii
Chapter 6 algebraic expressions iii
Khusaini Majid
solving quadratic equations using quadratic formula
solving quadratic equations using quadratic formula
maricel mas
Ad

More from shivam choubey (10)

Simulation Investigation of Separated Nozzle Flows
Simulation Investigation of Separated Nozzle Flows
shivam choubey
steady state CFD simulation on basic shapes and calculate Cd value
steady state CFD simulation on basic shapes and calculate Cd value
shivam choubey
External Aerodynamics (Ahmed body)
External Aerodynamics (Ahmed body)
shivam choubey
Airfoil Analysis(NACA 0012 ) Ansys Fluent
Airfoil Analysis(NACA 0012 ) Ansys Fluent
shivam choubey
Couette flow Ansys simulation
Couette flow Ansys simulation
shivam choubey
Mixing elbow simulation Ansys
Mixing elbow simulation Ansys
shivam choubey
sin cos & tan (Plot using MATLAB)
sin cos & tan (Plot using MATLAB)
shivam choubey
The Singular Value Decomposition theroy + example
The Singular Value Decomposition theroy + example
shivam choubey
1-D Steady Heat conduction FDM
1-D Steady Heat conduction FDM
shivam choubey
The finite volume method for diffusion problems
The finite volume method for diffusion problems
shivam choubey
Simulation Investigation of Separated Nozzle Flows
Simulation Investigation of Separated Nozzle Flows
shivam choubey
steady state CFD simulation on basic shapes and calculate Cd value
steady state CFD simulation on basic shapes and calculate Cd value
shivam choubey
External Aerodynamics (Ahmed body)
External Aerodynamics (Ahmed body)
shivam choubey
Airfoil Analysis(NACA 0012 ) Ansys Fluent
Airfoil Analysis(NACA 0012 ) Ansys Fluent
shivam choubey
Couette flow Ansys simulation
Couette flow Ansys simulation
shivam choubey
Mixing elbow simulation Ansys
Mixing elbow simulation Ansys
shivam choubey
sin cos & tan (Plot using MATLAB)
sin cos & tan (Plot using MATLAB)
shivam choubey
The Singular Value Decomposition theroy + example
The Singular Value Decomposition theroy + example
shivam choubey
1-D Steady Heat conduction FDM
1-D Steady Heat conduction FDM
shivam choubey
The finite volume method for diffusion problems
The finite volume method for diffusion problems
shivam choubey
Ad

Recently uploaded (20)

Fatality due to Falls at Working at Height
Fatality due to Falls at Working at Height
ssuserb8994f
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
ketan09101
Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
Unit III_One Dimensional Consolidation theory
Unit III_One Dimensional Consolidation theory
saravananr808639
special_edition_using_visual_foxpro_6.pdf
special_edition_using_visual_foxpro_6.pdf
Shabista Imam
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
Abraham Silberschatz-Operating System Concepts (9th,2012.12).pdf
Abraham Silberschatz-Operating System Concepts (9th,2012.12).pdf
Shabista Imam
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Fundamentals of Digital Design_Class_21st May - Copy.pptx
drdebarshi1993
Learning Types of Machine Learning Supervised Learning Unsupervised UNI...
Learning Types of Machine Learning Supervised Learning Unsupervised UNI...
23Q95A6706
DESIGN OF REINFORCED CONCRETE ELEMENTS S
DESIGN OF REINFORCED CONCRETE ELEMENTS S
prabhusp8
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
machine learning is a advance technology
machine learning is a advance technology
ynancy893
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
Mechanical Vibration_MIC 202_iit roorkee.pdf
Mechanical Vibration_MIC 202_iit roorkee.pdf
isahiliitr
Fatality due to Falls at Working at Height
Fatality due to Falls at Working at Height
ssuserb8994f
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
ketan09101
Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
Unit III_One Dimensional Consolidation theory
Unit III_One Dimensional Consolidation theory
saravananr808639
special_edition_using_visual_foxpro_6.pdf
special_edition_using_visual_foxpro_6.pdf
Shabista Imam
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
Abraham Silberschatz-Operating System Concepts (9th,2012.12).pdf
Abraham Silberschatz-Operating System Concepts (9th,2012.12).pdf
Shabista Imam
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Fundamentals of Digital Design_Class_21st May - Copy.pptx
drdebarshi1993
Learning Types of Machine Learning Supervised Learning Unsupervised UNI...
Learning Types of Machine Learning Supervised Learning Unsupervised UNI...
23Q95A6706
DESIGN OF REINFORCED CONCRETE ELEMENTS S
DESIGN OF REINFORCED CONCRETE ELEMENTS S
prabhusp8
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
machine learning is a advance technology
machine learning is a advance technology
ynancy893
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
Mechanical Vibration_MIC 202_iit roorkee.pdf
Mechanical Vibration_MIC 202_iit roorkee.pdf
isahiliitr

Solve the set of linear equations

  • 1. www.engineeringwithsandeep.com| Student Assignment Assignment No. 04 Solve the set of linear equations 04.04.2021 Shivam Choubey Student No: CFDB30321004
  • 2. www.engineeringwithsandeep.com| Student Assignment Gauss Elimination % solve Gauss elimination method consider % 2a+2b-c+d=4 % 4a+3b-c+2d=6 % 8a+5b-3c+4d=12 %3a+3b-2c+2d=6 % checking A^-1*b A=[2 2 -1 1;4 3 -1 2;8 5 -3 4;3 3 -2 2]; b=[4 6 12 6]'; [n, n] = size(A); [n, k] = size(b); x = zeros(n,k); %%initial value for i = 1:n-1 m = -A(i+1:n,i)/A(i,i); A(i+1:n,:) = A(i+1:n,:) + m*A(i,:); b(i+1:n,:) = b(i+1:n,:) + m*b(i,:); end; disp("Matrix before back substitution ") A % Use back substitution to find unknowns x(n,:) = b(n,:)/A(n,n); for i = n-1:-1:1 x(i,:) = (b(i,:) - A(i,i+1:n)*x(i+1:n,:))/A(i,i); end disp("Value of a ,b ,c & d ") x disp("Checking result") disp("inverse of A") val=inv(A) disp("Value of a,b,c &d ") val*b Ouput >> Gauss Matrix before back substitution A = 2.0000 2.0000 -1.0000 1.0000 0 -1.0000 1.0000 0 0 0 -2.0000 0 0 0 0 0.5000 Value of a ,b ,c & d x = 1 1 -1 -1 Checking result inverse of A val = 0.5000 1.0000 0.2500 -1.0000 0 -1.0000 -0.5000 0 0 0 -0.5000 0 0 0 0 2.0000 Value of a,b,c &d ans = 1 1 -1 -1
  • 3. www.engineeringwithsandeep.com| Student Assignment Gauss Jordan Method function [x,err]=gauss_jordan_elim(A,b) A=[2 2 -1 1;4 3 -1 2;8 5 -3 4;3 3 -2 2]; b=[4 6 12 6]'; [n,m]=size(A); Aa=[A,b]; for i=1:n [Aa(i:n,i:n+1),err]=gauss_pivot(Aa(i:n,i:n+1)); if err == 0 Aa(1:n,i:n+1)=gauss_jordan_step(Aa(1:n,i:n+1),i); end end x=Aa(:,n+1); A=0;
  • 4. www.engineeringwithsandeep.com| Student Assignment Continue code function A1=gauss_jordan_step(A,i) [n,m]=size(A); A1=A; s=A1(i,1); A1(i,:) = A(i,:)/s; k=[[1:i-1],[i+1:n]]; for j=k s=A1(j,1); A1(j,:)=A1(j,:)-A1(i,:)*s; end % end of for loop function [A1,err]=gauss_pivot(A) [n,m]=size(A); A1=A; err = 0; if A1(1,1) == 0 check = logical(1); i = 1; end gauss_jordon ans = 1 1 -1 -1 Checking inv(A) ans = 1.0000 -0.5000 0.5000 -1.0000 1.0000 0.5000 -0.5000 0 -1.0000 1.5000 -0.5000 0 -4.0000 1.5000 -0.5000 2.0000 >> inv(A)*b ans = 1 1 -1 -1