Question: (a) (4 points) Given input consisting of . a positive integer n, . a vector a with n+1 entries ai,a2.,an+1 . a vector y with

(a) (4 points) Given input consisting of . a positive integer n, . a vector a with n+1 entries ai,a2.,an+1 . a vector y with n entries Ji. 2. yn, and a scalarr write a MATLAB function with header function p = PolyEva1 ( n, a, y, x ) to evaluate the polynomial an+1(ry)(r 2) (ys)(r yn) n+1 j-1 using Horner's algorithm. Include a copy of your function M-file in your solution pdf. Note. Your function should use exactly 3n flops (floating-point operations) (b) (2 points) Use your function M-file from (a) to evaluate p(1.53) when n = 5 and a=[-1, 3.3. 0,-22, 5, -1.6] Include the call to the function you used to get the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
