This is a static copy of a profile report

Home

spap2>spap21 (404 calls, 2.253 sec)
Generated 05-Nov-2014 07:52:38 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/spap2.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
spap2function404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
175
sp = spmak(knots,slvblk(spcol(...
2021.302 s57.8%
173
sp = spmak(knots,slvblk(spcol(...
2020.491 s21.8%
162
knots = aptknt(x(round(linspac...
4040.240 s10.7%
146
if isempty(w), [x,y,sizeval]  ...
4040.120 s5.3%
147
else           [x,y,sizeval,w]...
2020.090 s4.0%
All other lines  0.010 s0.4%
Totals  2.253 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
slvblkfunction4041.112 s49.3%
spcolfunction4040.501 s22.2%
aptkntfunction4040.190 s8.4%
chckxywpfunction4040.180 s8.0%
spmakfunction4040.170 s7.6%
linspacefunction4040 s0%
Self time (built-ins, overhead, etc.)  0.100 s4.4%
Totals  2.253 s100% 
Code Analyzer results
Line numberMessage
178FINDSTR will be removed in a future release. Use STRFIND instead.
Coverage results
[ Show coverage for parent directory ]
Total lines in function42
Non-code lines (comments, blank lines)10
Code lines (lines that can run)32
Code lines that did run19
Code lines that did not run13
Coverage (did run/can run)59.38 %
Function listing
   time   calls  line
143 function sp = spap21(knots,k,x,y,w)
144 %SPAP21 Univariate least squares spline approximation.
145
0.12 404 146 if isempty(w), [x,y,sizeval] = chckxywp(x,y,1);
0.09 202 147 else [x,y,sizeval,w] = chckxywp(x,y,1,w);
202 148 end
404 149 nx = length(x);
150
404 151 if length(knots)==1 % we are to use a spline with KNOTS pieces
404 152 k = min(k,nx); maxpieces = nx-k+1;
0.01 404 153 if knots<1||knots>maxpieces
154 warning(message('SPLINES:SPAP2:wrongknotnumber', sprintf( '%g', maxpieces )))
155 knots = max(1,min(maxpieces,knots));
156 end
404 157 if knots==1&&k==1
158 if nx==1, knots = [x(1) x(1)+1];
159 else knots = x([1 end]).';
160 end
404 161 else
0.24 404 162 knots = aptknt(x(round(linspace(1,nx,knots-1+k))),k);
404 163 end
404 164 end
165
166 % Generate the collocation matrix and divide it into the possibly reordered
167 % sequence of given values to generate the B-spline coefficients of the
168 % interpolant, then put it all together into SP. But trap any error from
169 % SLVBLK, in order to provide a more helpful error message.
170
404 171 try
404 172 if isempty(w)
0.49 202 173 sp = spmak(knots,slvblk(spcol(knots,k,x,'slvblk','noderiv'),y).');
202 174 else
1.30 202 175 sp = spmak(knots,slvblk(spcol(knots,k,x,'slvblk','noderiv'),y,w).');
202 176 end
177 catch laster
178 if ~isempty(findstr('SLVBLK',laster.identifier))
179 error(message('SPLINES:SPAP2:noSWconds'))
180 else
181 rethrow(laster.message)
182 end
183 end
404 184 if length(sizeval)>1, sp = fnchg(sp,'dz',sizeval); end