Question: 2. [20 pts] Write a MATLAB function that can be used to solve a quadratic equation: ax-bx+4c0 The inputs to the function are the three
2. [20 pts] Write a MATLAB function that can be used to solve a quadratic equation: ax-bx+4c0 The inputs to the function are the three coefficients a, b, and c. . Check if the equation has real solutions. If there are no real solution the program should display THERE ARE NO REAL SOLUTIONS', then quit the program. Otherwise, calculate the solutions and display them as shown in the following example (use the fprintf command showing each solution with 4 decimal points). For example: The solutions are -3.4135 and 9.7435 Try to solve two quadratic equations with coefficients: a b, c]-4]and [a.b, c 15 -1 3] Submit the m file for your function, and the results of both test runs done in MATLAB (again copy and paste them in the word file)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
