In: Computer Science
MATLAB: Write as a script in the editor window of matlab.
Quadratic roots. Write a program, quadroots.m, for finding the roots of the second- order polynomial ax2 + bx + c. Use the quadratic equation. The inputs are the coefficients a,b, and c and the outputs are z1 and z2. The program should produce (exactly) the following output in the Command window when run with (a, b, c) = (1, 2, −3):
% MATLAB Function to solve the root of a quadratic equation function [z1, z2] = GetRoot(a,b,c) d = (b^2)-(4*a*c); z1 = (-b-sqrt(d))/(2*a); z2 = (-b+sqrt(d))/(2*a); end
Note: Please provide the output if you want according to it.