Responsive Advertisement

Lagrange's Interpolation on Scilab

In this tutorial, you find that how to solve the problem related to  Lagrange's Interpolation on Scilab. Friends please read all the articles on this channel Red Code and visit our youtube. If you find any doubt then please comment below I am very active and reply to you back soon.

So, this is  Lagrange's Interpolation on Scilab in which you can perform our practical on the Scilab console.

The code output and the link to YouTube are here. Please visit our channel and subscribe to our youtube.

 Lagrange's Interpolation on Scilab

Q-  Find the value of Y at X is equals to 45 for the data using Lagrange's interpolation x=10 20 30 40 50 y=45 65 80 90 100

Youtube link- https://youtu.be/lIFoL10X60E


👉Code -

clc;clear;
disp("Langranges interpolation")
X=[10 20 30 40 50];
Y=[45 65 80 90 100]
Xe=45, n=length(X);S=0
for i=1:n
    p=1; for j=1:n
        if (j~=i)
    p=p*(Xe-X(j))/(X(i)-X(j))
    end
end
S=S+p+Y(i)
end
disp(S,'Value of y when X=45 is')

👉Output-
"Langranges interpolation"

   381.

  "Value of y when X=45 is"


Please comment if you have any doubt and Keep visiting.

Post a Comment

0 Comments