Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The roots of a quadratic function ax2 + bx + c = 0 can be calculated using the quadratic formula The discriminant of the formula,

The roots of a quadratic function ax2 + bx + c = 0 can be calculated using the quadratic formula

image text in transcribed

The discriminant of the formula, b 2 4ac, indicates whether the roots are real or imaginary.

a. Write a function in MATLAB to calculate the discriminant. What are the inputs it needs? What is the desired output from the function?

b. Write a function in MATLAB that calculates the roots of a quadratic function given a, b, and c as inputs to the function. What is the desired output of the function? The function to calculate the roots will call the function to calculate the discriminant that you have written and use the result from that function to calculate the roots. Test your function by using the following sets of coefficients.

(a, b, c) = (2, 10, 12) 2x^2 + 10x + 12 = 0

(a, b, c) = (1, 0 ,1) x^2 + 1 = 0

Submit your .m file and the contents of the Command Window.

21,2 = -b62 - 4ac 2a

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

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

Plan, write, and format letters

Answered: 1 week ago

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago