Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I NEED HELP WITH BOTH 1. Write a MATLAB function, called Lagrange_poly that inputs a set of data points (x,y)=(datx, daty), a set r of

image text in transcribedimage text in transcribedI NEED HELP WITH BOTH

1. Write a MATLAB function, called Lagrange_poly that inputs a set of data points (x,y)=(datx, daty), a set r of numbers at which to interpolate, and outputs the polynomial interpolant, y, evaluated at x using Lagrange polynomial interpolation. Your function header should look something like: function y Lagrange-poly(x, datx, daty) = (a) Use the code you developed to interpolate the functions i, fi(z) = e-z? ii, f2(x) using the datapoints datx= 3:1:3. Interpolate at the points-3:0.01 :3 Call Pi thea- grange interpolant of f, and P2 the Lagrange interpolant of f2. Repeat the experiment except using the data datxl--3:0.5:3. Call in that case P3 and P4 the new interpolants. Compare your 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

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago