Spline Toolbox | ![]() ![]() |
From knots to breaks and/or their multiplicities
Syntax
Description
The commands extract the distinct elements from a sequence, as well as their multiplicities in that sequence, with multiplicity taken in two slightly different senses.
returns the distinct elements in knt2brk(knots)
knots
, and in increasing order.
additionally provides, in [breaks,mults]=knt2brk(knots)
mults
, the multiplicity with which each distinct element occurs in knots
. Explicitly, breaks
and mults
are of the same length, and knt2brk
is complementary to brk2knt
in that, for any knot sequence knots,
the two commands [xi,mlts] = knt2brk(knots); knots1 = brk2knt(xi,mlts);
give knots1
equal to knots
.
returns a vector of the same length as m=knt2mlt(t)
t
, with m(i)
counting, in the vector sort(t)
, the number of entries before its
ith entry that are equal to that entry. This kind of multiplicity vector is needed in spapi
or spcol
where such multiplicity is taken to specify which particular derivatives are to be matched at the sites in t
. Precisely, if t
is nondecreasing and z
is a vector of the same length, then sp = spapi(knots, t, z)
attempts to construct a spline s (with knot sequence knots
) for which equals
, all
.
also returns the output from [m,sortedt]=knt2mlt(t)
sort(t)
.
Neither knt2brk
nor knt2mlt
is likely to be used by the casual user of this toolbox.
Examples
[xi,mlts]=knt2brk([1 2 3 3 1 3])
returns [1 2 3]
for xi
and [2 1 3]
for mlts
.
[m,t]=knt2mlt([1 2 3 3 1 3])
returns [0 1 0 0 1 2]
for m
and [1 1 2 3 3 3]
for t
.
See Also
![]() | getcurve | newknt | ![]() |