Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please can you explain the code PL Write a MATLAB function, called Lagrange-poly that inputs a set of data points (x,y)=(datx, daty), a set z

Please can you explain the code

image text in transcribedPL

Write a MATLAB function, called Lagrange-poly that inputs a set of data points (x,y)=(datx, daty), a set z of numbers at which to interpolate, and outputs the polynomial interpolant, y, evaluated at r using Lagrange polynomial interpolation. Your function header should look something like: 1. function y Lagrange-poly(x,datx, daty) = (a) Use the code you developed to interpolate the functions 1+z2 using the data points datx--3 : 1 : 3. Interpolate at the points x=-3: 0 . 01 : 3. Call Pl the La- grange interpolant of f. and P2 the Lagrange interpolant of /2. Repeat the experiment except using the data datxl--3:0.5:3. Call in that case P3 and P4 the new interpolants. Compare r answer for this problem to what you got previously. For each interpolation problem, plot on the same graph the function, the two interpolants, and the data set (use the function scatter). Comment the results in your matlab script using %

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_2

Step: 3

blur-text-image_3

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions