Question
Use MATLAB to write a function subroutine horner_yourlastname(a, x0, d) that uses Horners algorithm to evaluate a polynomial at a given point x0. This code
Use MATLAB to write a function subroutine horner_yourlastname(a, x0, d) that uses Horners algorithm to evaluate a polynomial at a given point x0.
This code should have three inputs in the order specified above:
a: a vector of coefficients of the polynomial of interest. The first element of the vector should be the leading coefficient, and the last element should be the trailing coefficient. i. e. The polynomial p(x) = anx n + an1x n1 . . . a1x + a0 should have associated vector a = [an, an1, . . . , a1, a0].
x0: the point at which the polynomial is to be evaluated.
d {0, 1}: a toggle that allows the function to be evaluated at the point if d = 0 or its derivative to be evaluated at the point if d = 1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started