Question: 2. [20 pts) Write a MATLAB function that can be used to solve a quadratic equation: 3ax2 - 4x +2c=0 The inputs to the function
2. [20 pts) Write a MATLAB function that can be used to solve a quadratic equation: 3ax2 - 4x +2c=0 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] =[1,2,4and (a,b,c] - [5 -2 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
To create a MATLAB function for solving the quadratic equation 3ax2 4x 2c 0 follow these steps Step ... View full answer
Get step-by-step solutions from verified subject matter experts
