Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The roots of a quadratic function ax + bx + c = 0 can be calculated using the quadratic formula 1,2 -bb2-4ac 2a The
The roots of a quadratic function ax + bx + c = 0 can be calculated using the quadratic formula 1,2 -bb2-4ac 2a The discriminant of the formula, b2-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) (a, b, c) = (1,0,1) 2x+10x+12 0 x+1=0 Submit your .m files and the contents of the Command Window to Blackboard.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started