brk2knt
Convert breaks with multiplicities into knots
Syntax
knots = brk2knt(breaks,mults)
Description
knots = brk2knt(breaks,mults)
returns the sequenceknots
that is the sequencebreaks
but withbreaks(i)
occurringmults(i)
times, alli
。特别是,breaks(i)
will not appear unlessmults(i)>0
。If, as one would expect,breaks
is a strictly increasing sequence, thenknots
contains eachbreaks(i)
exactlymults(i)
times.
Ifmults
does not have exactly as many entries as doesbreaks
, then allmults(i)
are set equal tomults(1)
。
Examples
The statements
t = [1 1 2 2 2 3 4 5 5]; [xi,m] = knt2brk(t); tt = brk2knt(xi,m)
give[1 2 3 4 5]
forxi
,[2 3 1 1 2]
form
, and, finally,t
fortt
。