Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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
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