This is a static copy of a profile reportHome
brk2knt (808 calls, 0.070 sec)
Generated 05-Nov-2014 07:53:25 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/brk2knt.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
augknt | function | 808 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
44 | end | 808 | 0.010 s | 14.3% |  |
43 | t = breaks(cumsum(mm)); | 808 | 0.010 s | 14.3% |  |
41 | mm = zeros(1,s); | 808 | 0.010 s | 14.3% |  |
32 | else | 808 | 0.010 s | 14.3% |  |
30 | if s==0 | 808 | 0.010 s | 14.3% |  |
All other lines | | | 0.020 s | 28.6% |  |
Totals | | | 0.070 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 44 |
Non-code lines (comments, blank lines) | 30 |
Code lines (lines that can run) | 14 |
Code lines that did run | 13 |
Code lines that did not run | 1 |
Coverage (did run/can run) | 92.86 % |
Function listing
time calls line
1 function t = brk2knt(breaks,mults)
2 %BRK2KNT Breaks with multiplicities into knots.
3 %
4 % T = BRK2KNT(BREAKS,MULTS) returns the sequence T in which, for each i,
5 % BREAKS(i) is repeated MULTS(i) times.
6 % If BREAKS is strictly increasing, then T is the knot sequence in which
7 % each BREAKS(i) occurs exactly MULTS(i) times.
8 %
9 % If MULTS is to be constant, then only that constant value need be given.
10 %
11 % [T,INDEX] = BRK2KNT(BREAKS,MULTS) also returns
12 % INDEX = [1 find(diff(T)>0)-1] . If all multiplicities are positive,
13 % then, for all j, INDEX(j) is the first place in T at which BREAKS(j)
14 % appears.
15 %
16 % Example:
17 % t = brk2knt(1:2,3)
18 % gives t = [1 1 1 2 2 2], while
19 %
20 % t = [1 1 2 2 2 3 4 5 5]; [xi,m] = knt2brk(t); tt = brk2knt(xi,m);
21 %
22 % gives [1 2 3 4 5] for xi , [2 3 1 1 2] for m , and t for tt.
23 %
24 % See also KNT2BRK, KNT2MLT, AUGKNT.
25
26 % Copyright 1987-2008 The MathWorks, Inc.
27 % $Revision: 1.1.6.1 $
28
808 29 s = sum(mults);
0.01 808 30 if s==0
31 t = [];
0.01 808 32 else
808 33 li = length(breaks);
34 % make sure there is a multiplicity assigned to each break,
35 % and drop any break whose assigned multiplicity is not positive.
808 36 if length(mults)~=li, mults = repmat(mults(1),1,li); s = mults(1)*li;
808 37 else
808 38 fm = find(mults<=0);
808 39 if ~isempty(fm), breaks(fm)=[]; mults(fm)=[]; li = length(breaks); end
808 40 end
0.01 808 41 mm = zeros(1,s);
808 42 mm(cumsum([1 reshape(mults(1:li-1),1,li-1)])) = ones(1,li);
0.01 808 43 t = breaks(cumsum(mm));
0.01 808 44 end