This is a static copy of a profile report

Home

augknt (808 calls, 0.200 sec)
Generated 05-Nov-2014 07:52:40 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/augknt.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
aptkntfunction404
spcolfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
52
augknot = brk2knt(knots([1 int...
8080.130 s65.0%
50
if length(mults)~=length(inter...
8080.030 s15.0%
44
j=find(dk>0); if isempty(j)
8080.020 s10.0%
38
end
8080.010 s5.0%
37
mults = 1;
8080.010 s5.0%
All other lines  0.000 s0.0%
Totals  0.200 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
brk2kntfunction8080.070 s35.0%
repmatfunction4040.020 s10.0%
Self time (built-ins, overhead, etc.)  0.110 s55.0%
Totals  0.200 s100% 
Code Analyzer results
Line numberMessage
35Use || instead of | as the OR operator in (scalar) conditional statements.
41To improve performance, replace ISEMPTY(FIND(X)) with ISEMPTY(FIND( X, 1 )).
43The value assigned to variable 'augknot' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function52
Non-code lines (comments, blank lines)38
Code lines (lines that can run)14
Code lines that did run12
Code lines that did not run2
Coverage (did run/can run)85.71 %
Function listing
   time   calls  line
1 function [augknot,addl] = augknt(knots,k,mults)
2 %AUGKNT Augment a knot sequence.
3 %
4 % AUGKNT(KNOTS,K) returns a nondecreasing and augmented knot
5 % sequence which has the first and last knot with exact multiplicity K .
6 % (This may actually shorten the knot sequence.)
7 %
8 % [AUGKNOT,ADDL] = AUGKNT(KNOTS,K) also returns the number of knots
9 % added on the left. (This may be negative.)
10 %
11 % AUGKNOT = AUGKNT(KNOTS,K,MULTS) returns an augmented knot sequence
12 % that, in addition, contains each interior knot MULTS times. If
13 % MULTS has exactly as many entries as there are interior knots,
14 % then the j-th one (in the ordered sequence) will be repeated MULTS(j)
15 % times. Otherwise, the uniform multiplicity MULTS(1) is used, whose
16 % default value is 1 . If the sequence of interior knots in KNOTS is
17 % *strictly* increasing, then this ensures that the splines of order K
18 % with knot sequence AUGKNOT satisfy K-MULTS(j) smoothness conditions
19 % across the j-th interior break, all j .
20 %
21 % For example, the statement
22 %
23 % ch = spapi(augknt(x,4,2), [x x], [y dy]);
24 %
25 % constructs the piecewise cubic Hermite interpolant, i.e., the function s
26 % in ch satisfies s(x(i)) = y(i), (Ds)(x(i)) = dy(i), all i (assuming
27 % that x is strictly increasing).
28 %
29 % See also SPALLDEM.
30
31 % Copyright 1987-2008 The MathWorks, Inc.
32 % $Revision: 1.1.6.2 $ $Date: 2010/10/08 16:37:48 $
33
808 34 if nargin<3
808 35 if (length(k)>1|k<1)
36 error(message('SPLINES:AUGKNT:wrongk')), end
0.01 808 37 mults = 1;
0.01 808 38 end
39
808 40 dk = diff(knots);
808 41 if ~isempty(find(dk<0)), knots = sort(knots); dk = diff(knots); end
42
808 43 augknot=[];
0.02 808 44 j=find(dk>0); if isempty(j)
45 error(message('SPLINES:AUGKNT:toofewknots')), end
808 46 addl = k-j(1);
47
808 48 interior = (j(1)+1):j(end);
49 % % make sure there is a multiplicity assigned to each interior knot:
0.03 808 50 if length(mults)~=length(interior), mults = repmat(mults(1),size(interior)); end
51
0.13 808 52 augknot = brk2knt(knots([1 interior end]), [k mults k]);