Question: ) Where indicated below, complete the function, lagrange ( ) , which takes two input vectors of data points x and y , of any
Where indicated below, complete the function, lagrange which takes two input vectors of data points x and y of any length n either both column or row vectors along with input scalar, a and computes output, p which is the Lagrange interolating polynomial, evaluated at a:
In the formula, and refer to elements in vectors x and y
Use one outer forloop with one inner forloop with an ifstatement or two successive inner forloops without an if statement You may need to initialize a running sum before the outer loop, and initialize a running product just before the inner loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
