This is a static copy of a profile report

Home

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 NameFunction TypeCalls
aptkntfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
31
temp = repmat(t,1,k-1);
4040.050 s50.0%
29
elseif k==2, tstar = reshape(t...
4040.020 s20.0%
32
temp = sum(reshape([temp(:);ze...
4040.010 s10.0%
26
t = t(:); n = length(t)-k;
4040.010 s10.0%
34
end
4040 s0%
All other lines  0.010 s10.0%
Totals  0.100 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
repmatfunction4040.040 s40.0%
Self time (built-ins, overhead, etc.)  0.060 s60.0%
Totals  0.100 s100% 
Code Analyzer results
Line numberMessage
29Use of brackets [] is unnecessary. Use parentheses to group, if needed.
33Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function34
Non-code lines (comments, blank lines)25
Code lines (lines that can run)9
Code lines that did run9
Code lines that did not run0
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