Question: Answer using Matlab Table 1: x y 2 -4 3 9 5 28 8 20 10 -2 11 4 1 (20%) Write a function that

Answer using Matlab
Table 1:
| x | y |
|---|---|
| 2 | -4 |
| 3 | 9 |
| 5 | 28 |
| 8 | 20 |
| 10 | -2 |
| 11 | 4 |
1" (20%) Write a function that implements Lagrange interpolation, with the following input/output. function y Lagrange (datapt X, da taptY,x) end In the input bracket, where dataX and dataY are two arrays that storing values of the data points for interpolating (,yl), and x is the value of x in the function for calculating y. if you have n+1 points (meaning n + 1 elements in dataX, dataY), you should fit nth order Lagrange. Use all the values from table 1, and calculate x-9.5 through the program and give the answer. 2" (20%) Write a function that implements the Bisection method, with the following input/output function y = Bisection (f, xl, xu , mvalue) end % note f in the argument list is a function input. For example f representing the function f(x) in question 3 can be defined under the following way f = @ (x) exp(x)+x"3+2*x"2-1.2, and then you can use f directly as a function in Bisection(f,xl, xu, mvalue) xl and xu is your lower and upper boundary mvalue is the predefined threshold represented as m-value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
