Convert knots to breaks and their multiplicities
[breaks,mults] = knt2brk(knots)
m = knt2mlt(t)
[m,sortedt] = knt2mlt(t)
[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 Dm(i)s(t(i)) equals z(i), all i.
Neither knt2brk nor knt2mlt is likely to be used by the casual user of this toolbox.
[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.