summaryrefslogtreecommitdiff
path: root/1670/CH5/EX5.50/5_50.sce
blob: 7b59a67de57ee64dccdaddf5c060026d945bb35a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//Example 5.50
//Spline Interpolation
//Page no. 204
clc;close;clear;

xi=[1,2,3];
yi=[-1,4,21];
x=poly(0,'x')
deff('y=S(x0,x1)','y=(x-xi(x1))*yi(x0)/(xi(x0)-xi(x1))+(x-xi(x0))*yi(x1)/(xi(x1)-xi(x0))');
S1=S(1,2);
S2=S(2,3);
printf('\n The required Spline is : \n')
disp(S2,'S2 = ',S1,'S1 = ');