blob: d133990b2af487225c8cb637a0f7dca65fba06ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
//Clearing console
clc
clear
s = poly(0,"s")
//Calculating Constants in interpolation functions
c1 = 1/((-1/3)*(-2/3)*(-1))
c2 = 1/((1/3)*(-1/3)*(-2/3))
c3 = 1/((2/3)*(1/3)*(-1/3))
c4 = 1/((1)*(2/3)*(1/3))
//interpolation functions
N1 = c1*(s-1/3)*(s-2/3)*(s-1)
N2 = c2*(s)*(s-2/3)*(s-1)
N3 = c3*(s)*(s-1/3)*(s-1)
N4 = c4*(s)*(s-1/3)*(s-2/3)
//Printing Results
printf('\nInterpolation Functions\n')
printf('N1(x) =')
disp(N1)
printf('N2(x) =')
disp(N2)
printf('N3(x) =')
disp(N3)
printf('N4(x) =')
disp(N4)
|