Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The Lagrange interpolation formula, evaluates y p(), where z is given and p is the (unique) degree-n polynomial that interpolates n+1 given coor- dinate

image text in transcribed

1. The Lagrange interpolation formula, evaluates y p(), where z is given and p is the (unique) degree-n polynomial that interpolates n+1 given coor- dinate pairs. (zo, yo), (z, y), , (zn,Yn). ("Interpolates" means intersects. i.., yi-p(zi) for i-0,1, ,n.) (a) Implement this as a Matlab function with the signature function y - linterp(X, Y, x) (X and Y are arrays containing zo, .In and yo, , yn, resp.) You may not use any of Matlab's polynomial routines (like polyfit or interp1) nor the Symbolic Math Toolbox Test your code by 1. picking your favorite polynomial p of degree five, 2. populating X with six distinct numbers, 3. setting Y to be p evaluated at the corresponding entries of X, using polyval 4. picking x to be a number besides those in x. 5. comparing p(x) with linterp(X, Y, x) For example, implement2,5-1 by p-0(x) polyval([ 1 0 0 0 0-1], x)

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions