Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Consider the MATLAB function GaussPivot() given in class in slide 5-31. (a) Modify GaussPivot() so that it computes and returns the determinant (with the
3. Consider the MATLAB function GaussPivot() given in class in slide 5-31.
(a) Modify GaussPivot() so that it computes and returns the determinant (with the correct sign) and
detects whether the system is singular based on a near-zero determinant. Define near-zero as
being when the absolute value of the determinant is below a tolerance. When this occurs, the
function should display an error message and terminate. The first line of the function should be:
function [x, D] = GaussPivot2(A, b, tol) where D is the determinant, and tol is the tolerance. Do not use the Matlab det() function.
(b) Showtheresultofrunningyourfunctiononthefollowingsystemofequationswithtol=0.00001
2x2 + 5x3 = 1
2x1+x2 +x3=1 4x1 +2x2 +2x3 =4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started