Documentation |
Convert knots to breaks and their multiplicities
knt2brk(knots)
[breaks,mults] = knt2brk(knots)
m = knt2mlt(t)
[m,sortedt] = knt2mlt(t)
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.
knt2brk(knots) returns the distinct elements in knots, and in increasing order, hence is the same as unique(knots).
[breaks,mults] = knt2brk(knots) additionally provides, in 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.
m = knt2mlt(t) returns a vector of the same length as 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 D^{m}^{(}^{i}^{)}s(t(i)) equals z(i), all i.
[m,sortedt] = knt2mlt(t) also returns the output from sort(t).
Neither knt2brk nor knt2mlt is likely to be used by the casual user of this toolbox.