Question: ******************************************MatLab Help please! ******************** Code that needs to be extended: Thank you! barycentric formula, TL 7 i-0 where we have defined the barycentric weights 7L

******************************************MatLab Help please! ********************

******************************************MatLab Help please! ******************** Code that needs to be extended: Thank you!

barycentric formula, TL 7 i-0 where we have defined the "barycentric weights" 7L j-0 While mathematically equivalent to the Lagrange interpolation formula, the barycentric

Code that needs to be extended: Thank you!

barycentric formula, TL 7 i-0 where we have defined the "barycentric weights" 7L j-0 While mathematically equivalent to the Lagrange interpolation formula, the barycentric formula has the prac- tical advantage that the bulk of the computation computing the barycentric weights-can be performed "offlinc" and is efficiently updatable to include more interpolation points (b) Extend your code to allow x to be an array, so that y is an array of the same dimensions, cach entry bcing the Lagrange interpolation formula evaluated at the corresponding entry of x. Reusing from Part (a) the polynomial function p and the arrays X and Y, run the following commands x linspace (min (X)-1, max (X)+1, 100); plot (x , p(x), 'ko: ', x, nterp-bary(X, Y, x), 'rx:'); The red xs should coincide with the black os function y !interp(X,Y, X) sigma-0; for i#1 : numel (X) for j=1 : numel (X) if j-i end end sigma = sigma + Y(1)"pii; end y - sigma end barycentric formula, TL 7 i-0 where we have defined the "barycentric weights" 7L j-0 While mathematically equivalent to the Lagrange interpolation formula, the barycentric formula has the prac- tical advantage that the bulk of the computation computing the barycentric weights-can be performed "offlinc" and is efficiently updatable to include more interpolation points (b) Extend your code to allow x to be an array, so that y is an array of the same dimensions, cach entry bcing the Lagrange interpolation formula evaluated at the corresponding entry of x. Reusing from Part (a) the polynomial function p and the arrays X and Y, run the following commands x linspace (min (X)-1, max (X)+1, 100); plot (x , p(x), 'ko: ', x, nterp-bary(X, Y, x), 'rx:'); The red xs should coincide with the black os function y !interp(X,Y, X) sigma-0; for i#1 : numel (X) for j=1 : numel (X) if j-i end end sigma = sigma + Y(1)"pii; end y - sigma end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!