This is a static copy of a profile report

Home

spval (1 call, 0.090 sec)
Generated 05-Nov-2014 07:52:41 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/spval.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
fnvalfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
59
v = ppual(sp2pp(sp),x);
10.070 s77.8%
60
temp = cell2mat(fnbrk(sp,'inte...
10.010 s11.1%
27
[t,a,n,~,d] = spbrk(sp); m = l...
10.010 s11.1%
62
end
10 s0%
61
v(min([x-repmat(temp(mm-1),1,n...
10 s0%
All other lines  0 s0%
Totals  0.090 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
sp2ppfunction10.040 s44.4%
ppualfunction10.020 s22.2%
spbrkfunction10.010 s11.1%
repmatfunction20 s0%
cell2matfunction10 s0%
fnbrkfunction10 s0%
Self time (built-ins, overhead, etc.)  0.020 s22.2%
Totals  0.090 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function67
Non-code lines (comments, blank lines)32
Code lines (lines that can run)35
Code lines that did run13
Code lines that did not run22
Coverage (did run/can run)37.14 %
Function listing
   time   calls  line
1 function v = spval(sp,x,left)
2 %SPVAL Evaluate function in B-form.
3 %
4 % This is the function used by FNVAL when a spline in B-form is to be
5 % evaluated.
6 %
7 % V = SPVAL(SP,X) returns the value, at the entries of X, of the
8 % function f whose B-form is in SP.
9 % V = SPVAL(SP,X,'l<anything>') takes f to be left-continuous.
10 % If f is m-variate and the third input argument is actually an m-cell,
11 % LEFT say, then, continuity from the left is enforced in the i-th
12 % variable if LEFT{i}(1) = 'l'.
13 %
14 % Roughly speaking, V is obtained by replacing each entry of X by the value
15 % of f there. The details, as laid out in the help for FNVAL, depend on
16 % whether or not f is scalar-valued and whether or not f is univariate.
17 %
18 % See also FNVAL, PPUAL, RSVAL, STVAL, PPVAL.
19
20 % Copyright 1987-2010 The MathWorks, Inc.
21 % $Revision: 1.1.6.3 $
22
1 23 if ~isstruct(sp)
24 error(message('SPLINES:SPVAL:fnnotstruct')), end
1 25 if iscell(sp.knots) % we are dealing with a tensor product spline
26
0.01 1 27 [t,a,n,~,d] = spbrk(sp); m = length(t);
28
1 29 if nargin>2 % set up left appropriately
30 if ~iscell(left)
31 temp = left; left = cell(1,m); [left{:}] = deal(temp);
32 end
1 33 else
1 34 left = cell(1,m);
1 35 end
36
1 37 if iscell(x) % evaluation on a mesh
38
39 v = a; sizev = [d,n]; nsizev = zeros(1,m);
40
41 for i=m:-1:1
42 nsizev(i) = length(x{i}(:));
43 v = reshape(...
44 spval1(spmak(t{i},reshape(v,prod(sizev(1:m)),sizev(m+1))), ...
45 x{i},left{i}), [sizev(1:m),nsizev(i)]);
46 sizev(m+1) = nsizev(i);
47 if m>1
48 v = permute(v,[1,m+1,2:m]); sizev(2:m+1) = sizev([m+1,2:m]);
49 end
50 end
51 if d>1
52 v = reshape(v,[d,nsizev]);
53 else
54 v = reshape(v,nsizev);
55 end
56
1 57 else % evaluation at scattered points;
58 % this will eventually be done directly here.
0.07 1 59 v = ppual(sp2pp(sp),x);
0.01 1 60 temp = cell2mat(fnbrk(sp,'interv')).'; mm = 2:2:(2*m); nx = size(x,2);
1 61 v(min([x-repmat(temp(mm-1),1,nx); repmat(temp(mm),1,nx)-x])<0) = 0;
1 62 end
63
64 else % we are dealing with a univariate spline
65 if nargin<3, left = []; end
66 v = spval1(sp,x,left);
67 end

Other subfunctions in this file are not included in this listing.