Question: In this problem, you will use MATLAB to compute the roots of a quadratic function as accurately as possible. Write a MATLAB function that computes
In this problem, you will use MATLAB to compute the roots of a quadratic function as accurately as possible. Write a MATLAB function that computes the roots of f(x) = ar' + hr + c , where a, b, and c are real constants. Write the function call as a) (x1,x2] = quadroots(a,b,c) where xI and x2 are the two roots. Make sure to minimize the effect of loss of significance, and reuse as few arithmetic operations as possible. You may need if statements to cover the cases when b is positive and when b is negative. Your function can also assume that b4ac
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
