This is a static copy of a profile reportHome
aveknt (404 calls, 0.100 sec)
Generated 05-Nov-2014 07:52:40 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/aveknt.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
aptknt | function | 404 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
31 | temp = repmat(t,1,k-1); | 404 | 0.050 s | 50.0% |  |
29 | elseif k==2, tstar = reshape(t... | 404 | 0.020 s | 20.0% |  |
32 | temp = sum(reshape([temp(:);ze... | 404 | 0.010 s | 10.0% |  |
26 | t = t(:); n = length(t)-k; | 404 | 0.010 s | 10.0% |  |
34 | end | 404 | 0 s | 0% |  |
All other lines | | | 0.010 s | 10.0% |  |
Totals | | | 0.100 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
repmat | function | 404 | 0.040 s | 40.0% |  |
Self time (built-ins, overhead, etc.) | | | 0.060 s | 60.0% |  |
Totals | | | 0.100 s | 100% | |
Code Analyzer results
Line number | Message |
29 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
33 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 34 |
Non-code lines (comments, blank lines) | 25 |
Code lines (lines that can run) | 9 |
Code lines that did run | 9 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function tstar = aveknt(t,k)
2 %AVEKNT Knot averages.
3 %
4 % AVEKNT(T,K) returns the averages of successive K-1 knots, i.e.,
5 % the points
6 %
7 % TSTAR(i) = ( T_{i+1} + ... + T_{i+K-1} ) / (K-1)
8 %
9 % recommended as good interpolation point choices when interpolating
10 % from S_{K,T} .
11 %
12 % For example, with k and the increasing sequence breaks given,
13 % the statements
14 %
15 % t = augknt(breaks,k); x = aveknt(t);
16 % sp = spapi( t , x, sin(x) );
17 %
18 % provide a spline interpolant to the sine function on the interval
19 % [breaks(1) .. breaks(end)] .
20 %
21 % See also SPAPIDEM, OPTKNT, APTKNT, CHBPNT.
22
23 % Copyright 1987-2008 The MathWorks, Inc.
24 % $Revision: 1.1.6.2 $
25
0.01 404 26 t = t(:); n = length(t)-k;
404 27 if k<2, error(message('SPLINES:AVEKNT:wrongk'))
404 28 elseif n<0, error(message('SPLINES:AVEKNT:toofewknots'))
0.02 404 29 elseif k==2, tstar = reshape(t(1+[1:n]),1,n);
404 30 else
0.05 404 31 temp = repmat(t,1,k-1);
0.01 404 32 temp = sum(reshape([temp(:);zeros(k-1,1)],n+k+1,k-1).')/(k-1);
404 33 tstar = temp(1+[1:n]);
404 34 end