`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
clear all
clc
format long;
X=0:0.2:2;
Y=sin(X);
y=num_diff(X,Y,0.27,2)
function y=num_diff(X,Y,x,d)
a=linterp_poly(X,Y);
for i=1:d
a=polyder(a);
end
y=polyval(a,x);
end
function a=linterp_poly(X,Y)
a=zeros(1,numel(X));
for i=1:numel(X)
aa=poly(X([1:i-1 i+1:end]));
a=a+Y(i)*aa/polyval(aa,X(i));
end
end
Kindly revert for any queries
Thanks.
3. For any function f and n1 distinct nodes ro,....Tn, Lagrange interpolation factors f P R where...
Problem 5 (programming): Create a MATLAB function named lagrange interp.m to perform interpolation using Lagrange polynomials. Download the template for function lagrange interp.m. The tem Plate is in homework 4 folder utl TritonED·TIue function lakes in the data al nodex.xi and yi, as well as the target x value. The function returns the interpolated value y. Here, xi and yi are vectors while x and y are scalars. You are not required to follow the template; you can create the...