n = 3
k = 3
xi =
1 3 4 7
a = 1
b = 7
xi_ext =
-2 -1 0 1 3 4 7 8 9 10
a =
-0.50000
0.33333
0.00000
0.00000
0.00000
0.00000
debug> exit
a =
-0.50000 0.25000
0.33333 0.58333
0.00000 0.08333
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
debug> exit
a =
debug> exit
a =
debug> exit
a =
debug> exit
a =
debug> exit
b =
0
2
6
4
1
-2
x =
4.079365
-0.079365
8.238095
1.285714
3.428571
-1.730159
debug> exit
octave:2>
octave:1> ex_notaknot
debug>
octave:1> ex_notaknot
debug> exit
a =
0.45000 0.51429
0.01667 0.46349
0.00000 0.21429
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
debug> exit
a =
debug> exit
a =
debug> exit
a =
debug> exit
a =
debug> exit
b =
2
6
4
1
0
2
x =
-8.1608
10.8852
2.0789
2.2602
-1.8801
9.0702
debug> exit
octave:2> quit
[johnson@hp octave]$ cd ../matlab/
[johnson@hp matlab]$ octave -q
octave:1> ex_splinecompare
the obtained natural, complete, and not-a-knot splines are
represented by (x1,s1), (x2,s2), and (x3,s3), respectively.
here are plots of the error between f and the three splines
debug> exit
here are plots of the error between f and the complete and not-a-knot splines
octave:2> who
min
n s2 x1 x3 __nargin__ y y1
y3
s1 s3 x2 xi k y0 y2
z
octave:3> max(y2)
ans = 0.99997
octave:4> max(y2-y0)
ans = 0.00010558
octave:5> max(abs(y2-y0))
ans = 0.00013608
octave:6> quit
[johnson@hp matlab]$ gedit ex_splinecompare.m &
[1] 3606
[johnson@hp matlab]$ octave -q
octave:1> ex_splinecompare
the obtained natural, complete, and not-a-knot splines are
represented by (x1,s1), (x2,s2), and (x3,s3), respectively.
here are plots of the error between f and the three splines
debug> exit
here are plots of the error between f and the complete and not-a-knot splines
octave:2> max(abs(y2-y0))
ans = 1.1770e-06
octave:3> .03/8
ans = 0.0037500
octave:4> .00013/64
ans = 2.0312e-06
octave:5> quit
[1]+ done gedit ex_splinecompare.m
[johnson@hp matlab]$