This is a static copy of a profile reportHome
spmak>chckknt (608 calls, 0.090 sec)
Generated 05-Nov-2014 07:53:25 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/spmak.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
spmak | function | 608 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
94 | if knots{j}(1)==knots{j}(end) | 810 | 0.030 s | 33.3% |  |
101 | index = find(knots{j}(k(j)+(1:... | 810 | 0.020 s | 22.2% |  |
109 | end | 810 | 0.010 s | 11.1% |  |
89 | n = sizec(j+1); k(j) = length(... | 810 | 0.010 s | 11.1% |  |
102 | if length(index)<n | 810 | 0 s | 0% |  |
All other lines | | | 0.020 s | 22.2% |  |
Totals | | | 0.090 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
89 | The variable 'k' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 25 |
Non-code lines (comments, blank lines) | 7 |
Code lines (lines that can run) | 18 |
Code lines that did run | 9 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 50.00 % |
Function listing
time calls line
85 function [knots,coefs,k,sizec] = chckknt(knots,coefs,sizec)
86 %CHCKKNT check knots, omit trivial B-splines
87
608 88 for j=1:length(sizec)-1
0.01 810 89 n = sizec(j+1); k(j) = length(knots{j})-n;
810 90 if k(j)<=0, error(message('SPLINES:SPMAK:knotsdontmatchcoefs')), end
810 91 if any(diff(knots{j})<0)
92 error(message('SPLINES:SPMAK:knotdecreasing'))
93 end
0.03 810 94 if knots{j}(1)==knots{j}(end)
95 error(message('SPLINES:SPMAK:extremeknotssame'))
96 end
97
98 % make sure knot sequence is a row matrix:
810 99 knots{j} = reshape(knots{j},1,n+k(j));
100 % throw out trivial B-splines:
0.02 810 101 index = find(knots{j}(k(j)+(1:n))-knots{j}(1:n)>0);
810 102 if length(index)<n
103 oldn = n; n = length(index);
104 knots{j} = reshape(knots{j}([index oldn+(1:k(j))]),1,n+k(j));
105 coefs = ...
106 reshape(coefs, [prod(sizec(1:j)),sizec(j+1),prod(sizec(j+2:end))]);
107 sizec(j+1) = n; coefs = reshape(coefs(:,index,:),sizec);
108 end
0.01 810 109 end