Hi,
There is a bug in spline.
I don't know where to report this, so I use this mail to send a bug.
For the complete case in function `spline`, when n > 2,
(line 138 ~ 139 in source code)
```
g(2:n-1,:) = (a(3:n,:) - a(2:n-1,:)) ./ h(2:n-1) - ...
(a(2:n-1,:) - a(1:n-2,:)) ./ h(1:n-2);
```
should be
```
g(2:n-1,:) = (a(3:n,:) - a(2:n-1,:)) ./ h(2:n-1, idx) - ...
(a(2:n-1,:) - a(1:n-2,:)) ./ h(1:n-2, idx);
```
and (line 147~150 in source code)
```
d = d(1:n-1,:);
c = c(1:n-1,:);
b = b(1:n-1,:);
a = a(1:n-1,:);
```
should be
```
d = d(1:n-1,:); d = reshape(permute(d, [2, 1]), 1, []);
c = c(1:n-1,:); c = reshape(permute(c, [2, 1]), 1, []);
b = b(1:n-1,:); b = reshape(permute(b, [2, 1]), 1, []);
a = a(1:n-1,:); a = reshape(permute(a, [2, 1]), 1, []);
```
sincerely,
ChingChuan Chen