## Documentation Center |

Acceptable knot sequence

`knots = aptknt(tau,k) ``[knots,k] = aptknt(tau,k) `

` knots = aptknt(tau,k) `
returns a knot sequence suitable for interpolation at the data sites

knots(i) < tau(i) < knots(i+k), i=1:length(tau)

with equality only at the extreme knots, each of which occurs
with exact multiplicity `k`.

If `tau` has fewer than `k` entries,
then `k` is reduced to the value `length(tau)`.
An error results if `tau` fails to be nondecreasing
and/or `tau(i)` equals `tau(i+k-1)` for
some `i`.

` [knots,k] = aptknt(tau,k) `also
returns the actual

If `tau` is equally spaced, e.g., equal to `linspace(a,b,n)` for
some `n>=4`, and `y` is a sequence
of the same size as `tau`, then `sp = spapi(aptknt(tau,4),tau,y)` gives
the cubic spline interpolant with the not-a-knot end condition. This
is the same cubic spline as produced by the command `spline(tau,y)`,
but in B-form rather than ppform.

If `tau` is very nonuniform, then use of the
resulting knot sequence for interpolation to data at the sites `tau` may
lead to unsatisfactory results.

Was this topic helpful?