Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

subject: MATLAB Lagrange Polynomial Interpolation The nh degree Lagrange polynoma rpolatig t (Tn+, Vnt-) is points ( ). (r2,2), n+1 We want to write a

subject: MATLAB

image text in transcribed

Lagrange Polynomial Interpolation The nh degree Lagrange polynoma rpolatig t (Tn+, Vnt-) is points ( ). (r2,2), n+1 We want to write a function file lagrangepoly.m with te following structure: function P lagra ng epoly(x, y, z) Here, and y wil be arrays contaning the interpolation data. The output P will be the Lagrange polynonnal evaluated at s. If s is an array, the function should r When complete, the code should work with code in the following way: turn an array. %x, y data pol nts x=[0 3 4.569); y= [ 0 .5 .7071 .8660 1); Sarray of 100 points evenly spaced from irst to last x value z = linspace (X (1), x (end), 100); sevaluate e Lagiange poly at each point in z pz = lagrangepoly(x, y, z); plot the Lagrange poly plot (z, pz) hold on plot the data plot (x, y,'''MarkerSize', 5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions