na-lab-lagrange

Version 1.0.0 (1.13 KB) by Akshay
code
1 Download
Updated 14 Nov 2022

View License

clc;
close all;
x=input("Enter values of xi");
y=input("Enter values of fi");
n=length(x);
p=input("Enter point");
for i=1:n
l(i)=1.0;
for j=1:n
if(j~=i)
l(i)=((p-x(j))/(x(i)-x(j)))*l(i);
end
end
end
sum=0.0;
for i=1:n
sum=sum+l(i)*y(i);
end
disp(sum);

Cite As

Akshay (2024). na-lab-lagrange (https://www.mathworks.com/matlabcentral/fileexchange/120413-na-lab-lagrange), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0