This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
aptknt | function | 404 |
spcol | function | 404 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
52 | augknot = brk2knt(knots([1 int... | 808 | 0.130 s | 65.0% |  |
50 | if length(mults)~=length(inter... | 808 | 0.030 s | 15.0% |  |
44 | j=find(dk>0); if isempty(j) | 808 | 0.020 s | 10.0% |  |
38 | end | 808 | 0.010 s | 5.0% |  |
37 | mults = 1; | 808 | 0.010 s | 5.0% |  |
All other lines | | | 0.000 s | 0.0% |  |
Totals | | | 0.200 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
brk2knt | function | 808 | 0.070 s | 35.0% |  |
repmat | function | 404 | 0.020 s | 10.0% |  |
Self time (built-ins, overhead, etc.) | | | 0.110 s | 55.0% |  |
Totals | | | 0.200 s | 100% | |
Code Analyzer results
Line number | Message |
35 | Use || instead of | as the OR operator in (scalar) conditional statements. |
41 | To improve performance, replace ISEMPTY(FIND(X)) with ISEMPTY(FIND( X, 1 )). |
43 | The value assigned to variable 'augknot' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 52 |
Non-code lines (comments, blank lines) | 38 |
Code lines (lines that can run) | 14 |
Code lines that did run | 12 |
Code lines that did not run | 2 |
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]);