Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete in MATLAB. 4. Write a MATLAB function to solve the quadratic equation ar? +bx+c= 0, using the classical quadratic formula 2+ = (-6762

Please complete in MATLAB.

image text in transcribed

4. Write a MATLAB function to solve the quadratic equation ar? +bx+c= 0, using the classical quadratic formula 2+ = (-6762 - 4ac)/(2a). (a) Test your function on the following cases: (i) a = 2, b=3, c=1, (ii) a = 1, b = 3, c = 4. In each case and for each choice of sign, verify the accuracy of the numerical solution by comparing it with the exact solution. (b) Now consider the case (iii) a = 1, b = 3, c= 8-14 One solution is l_ ~-3. Test your MATLAB script on case (iii). It should perform poorly, so modify it to obtain accurate approximate roots. Finally, use MATLAB to make a table which displays three sets of roots for case (iii), those calculated with your original function, your modified function, and MATLAB's internal roots function. 4. Write a MATLAB function to solve the quadratic equation ar? +bx+c= 0, using the classical quadratic formula 2+ = (-6762 - 4ac)/(2a). (a) Test your function on the following cases: (i) a = 2, b=3, c=1, (ii) a = 1, b = 3, c = 4. In each case and for each choice of sign, verify the accuracy of the numerical solution by comparing it with the exact solution. (b) Now consider the case (iii) a = 1, b = 3, c= 8-14 One solution is l_ ~-3. Test your MATLAB script on case (iii). It should perform poorly, so modify it to obtain accurate approximate roots. Finally, use MATLAB to make a table which displays three sets of roots for case (iii), those calculated with your original function, your modified function, and MATLAB's internal roots function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago