This is a static copy of a profile reportHome
sp2pp>sp2pp1 (2 calls, 0.020 sec)
Generated 05-Nov-2014 07:52:41 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/sp2pp.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
sp2pp | function | 2 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
77 | pp = ppmak([t(inter) t(inter(e... | 2 | 0.010 s | 50.0% |  |
71 | c = sprpp(tx,b); | 2 | 0.010 s | 50.0% |  |
70 | b = repmat(d*(1-k:0),d*l,1)+re... | 2 | 0 s | 0% |  |
69 | temp = repmat(d*inter,d,1)+rep... | 2 | 0 s | 0% |  |
68 | tx = tx-repmat(t(dinter).',1,2... | 2 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.020 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
ppmak | function | 2 | 0.010 s | 50.0% |  |
sprpp | function | 2 | 0.010 s | 50.0% |  |
repmat | function | 16 | 0 s | 0% |  |
spbrk | function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0 s | 0% |  |
Totals | | | 0.020 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 30 |
Non-code lines (comments, blank lines) | 13 |
Code lines (lines that can run) | 17 |
Code lines that did run | 12 |
Code lines that did not run | 5 |
Coverage (did run/can run) | 70.59 % |
Function listing
time calls line
48 function pp = sp2pp1(spline)
49 % Take apart the spline
50
2 51 [t,a,n,k,d] = spbrk(spline);
52
53 % and augment the knot sequence so that first and last knot each have
54 % multiplicity k .
55
2 56 index = find(diff(t)>0); addl = k-index(1); addr = index(end)-n;
2 57 if (addl>0||addr>0)
58 t = [repmat(t(1),1,addl) t(:).' repmat(t(n+k),1,addr)];
59 a = [zeros(d,addl) a zeros(d,addr)];
60 end
61
62 % From this, generate the pp description.
63
2 64 inter = find( diff(t)>0 ); l = length(inter);
2 65 if k>1
2 66 temp = repmat(inter,d,1); dinter = temp(:);
2 67 tx = repmat(2-k:k-1,d*l,1)+repmat(dinter,1,2*(k-1)); tx(:) = t(tx);
2 68 tx = tx-repmat(t(dinter).',1,2*(k-1)); a = a(:);
2 69 temp = repmat(d*inter,d,1)+repmat((1-d:0).',1,l); dinter(:) = temp(:);
2 70 b = repmat(d*(1-k:0),d*l,1)+repmat(dinter,1,k); b(:) = a(b);
0.01 2 71 c = sprpp(tx,b);
72 else temp = a(:,inter); c = temp(:);
73 end
74
75 % put together the pp
76
0.01 2 77 pp = ppmak([t(inter) t(inter(end)+1)],c,d);