This is a static copy of a profile report

Home

buffields (27 calls, 0.044 sec)
Generated 05-Aug-2011 13:01:01 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/buffields.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
separate_fieldsfunction27
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
20
s=rmfield(s,fd{i});
900.044 s100.0%
41
end
1080 s0%
21
end
900 s0%
19
eval(sprintf('b.%s=s.%s;', cha...
900 s0%
18
if (isfield(s,fd{i}))
1080 s0%
All other lines  0 s0%
Totals  0.044 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
rmfieldfunction900.033 s75.0%
Self time (built-ins, overhead, etc.)  0.011 s25.0%
Totals  0.044 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function41
Non-code lines (comments, blank lines)14
Code lines (lines that can run)27
Code lines that did run8
Code lines that did not run19
Coverage (did run/can run)29.63 %
Function listing
   time   calls  line
1 function [s,b]=buffields(s,fd)
2
3 % function [s,b]=buffields(s,fd)
4 %
5 % removes field specified in fd from structure s and stores field
6 % values and names in buffered structure, b.
7 %
8 % s - input structure
9 % fd - cell array of field names, {{'vis'},{'flags','visFlag'}}}
10 % - will remove fields vis, and flag.visFlag
11 % b - structure with fields specified in fd
12 %
13 % Michael Loh
14
27 15 b=[];
27 16 for i=1:length(fd)
108 17 if (length(fd{i})==1)
108 18 if (isfield(s,fd{i}))
90 19 eval(sprintf('b.%s=s.%s;', char(fd{i}), char(fd{i})));
0.04 90 20 s=rmfield(s,fd{i});
90 21 end
22 else
23 rm=1;
24 for j=1:length(fd{i})
25 if (j==1)
26 str='';
27 else
28 str=strcat(str,sprintf('.%s',char(fd{i}{j-1})));
29 end
30 if (~eval(sprintf('isfield(s%s,''%s'')',str,char(fd{i}{j}))))
31 rm=0;
32 break;
33 end
34 end
35 if (rm)
36 str2=strcat(str,sprintf('.%s',char(fd{i}{j})));
37 eval(sprintf('b%s=s%s;', str2, str2));
38 eval(sprintf('s%s=rmfield(s%s,fd{i}{j});',str,str));
39 end
40 end
108 41 end