Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1 (Type your name on every Script) A well-known formula for solving a q

ID: 3605932 • Letter: Q

Question

Question 1 (Type your name on every Script) A well-known formula for solving a quadratic f= ar, br + c is given by x where a, b and c are coefficients of the quadratic function. It is also known that f(x) means the value of the given function at x = Write a user-defined function that takes the coefficients and xi as input variables and outputs the 2a function value, fat xi and the two roots, x1 and x2. Call this function "Quad_VaIRoot. Write a main program-a script called "Quadprogram " to call/run the Quad_ ValRoot. Use your program to solve the equation f 1.019x. 3.718x + 1.416 and f(2.0178).

Explanation / Answer

function [fxi, x1, x2] = Quad_ValRoot(a, b, c, xi)
fxi = a.*xi.*xi + b.*xi + c;
x1 = (-b + (b.*b - 4.*a.*c).*0.5)/2*a;
x2 = (-b - (b.*b - 4.*a.*c).*0.5)/2*a;
end

[fxi, x1, x2] = Quad_ValRoot(1.019, -3.718, 1.416, 2.0178)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote