Question: 3. Write a MATLAB script to solve the quadratic equation ar? + bx+c = 0, using the classical quadratic formula r= (-5= Vb2 - 4ac)/(2a).

3. Write a MATLAB script to solve the quadratic equation ar? + bx+c = 0, using the classical quadratic formula r= (-5= Vb2 - 4ac)/(2a). Test your script on the following cases: (a) a=1, b = -3, C = 2. (b) a = 1, b = 2, c= 4. (c) a = 10-12, b = 5, C = 2. In each case and for each choice of sign, check the accuracy of the numerical solution by comparing it with the exact solution. Comment on your results for (c). Keeping floating-point arithmetic in mind, find a more stable method for computing solutions to quadratic equations and implement it. Does it improve your results for (c)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
