Applied Numerical Analysis with MATLAB Write a program in a script file that determines the real roots of a quadratic eq
Posted: Sun May 15, 2022 11:19 pm
Applied Numerical Analysis with MATLAB Write a program in a script file that determines the real roots of a quadratic equation: ax2 + bx + c = 0. = of When the file runs, it asks the user to enter the values of the constants a, b, and c. , To calculate the roots of the equation the program calculates the discriminant D, given by: D = b2 – 4ac . If D > 0, the program displays message "The equation has two roots," and the roots are displayed in the next line. If D = 0, the program displays message "The equation has one root," and the root is displayed in the next line. If D< 0, the program displays message "The equation has no real roots." Run the script file in the Command Window three times to obtain solutions to the following three equations: (a) 3x2 + 6x + 3 = 0 (b) – 3x2 + 4x – 6 = 0 (c) – 3x2 + 7x + 5 = 0 =