Question: This Numerical Methods question requires MATLAB. Please provide MATLAB code for this problem. Thank You! 3) Robustness (12 pts) Consider the version of the quadratic
3) Robustness (12 pts) Consider the version of the quadratic formula discussed in class. 1. Create a function that incorporates a flag parameter in addition to the a,b, and c inputs. For flag=1, the function applies the robust version of the quadratic formula, otherwise the function only apples the traditional quadratic formula. 2. Test the function for a=0,b=1, and c=2. Confirm that the traditional form of the equation throws a Nan error while the robust version does not. 3. Test the function for a=1, b=100, and c=1. Find the difference between the traditional and robust implementations for handling b ac as the 2-norm of the vector x that contains the roots. (Hint: use the norm command)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
