This is a static copy of a profile report

Home

ml_ls (20 calls, 0.561 sec)
Generated 05-Nov-2014 07:52:33 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/ml_ls.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
demo3D11function16
img2modelfunction4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
52
temp = strread( rows{i},'%s','...
16160.280 s50.0%
64
files = sort_nat( files );
200.200 s35.7%
47
list = ls( patterns{c} );
200.030 s5.4%
55
files{length(files)+1} = temp{...
16160.020 s3.6%
48
rows = strread( list, '%s', 'd...
200.020 s3.6%
All other lines  0.010 s1.8%
Totals  0.561 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strreadfunction16360.260 s46.4%
sort_natfunction200.190 s33.9%
lsfunction200.030 s5.4%
Self time (built-ins, overhead, etc.)  0.080 s14.3%
Totals  0.561 s100% 
Code Analyzer results
Line numberMessage
48STRREAD will be removed in a future release. Use TEXTSCAN instead.
51The value assigned to variable 'temp' might be unused.
52STRREAD will be removed in a future release. Use TEXTSCAN instead.
55The variable 'files' appears to change size on every loop iteration. Consider preallocating for speed.
59Best practice is for CATCH to be followed by an identifier that gets the error information.
66The variable 'patternnum' appears to change size on every loop iteration. Consider preallocating for speed.
71FOR might not be aligned with its matching END (line 94).
75STRREAD will be removed in a future release. Use TEXTSCAN instead.
78The value assigned to variable 'temp' might be unused.
79STRREAD will be removed in a future release. Use TEXTSCAN instead.
82The variable 'files' appears to change size on every loop iteration. Consider preallocating for speed.
86Best practice is for CATCH to be followed by an identifier that gets the error information.
93The variable 'patternnum' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function99
Non-code lines (comments, blank lines)45
Code lines (lines that can run)54
Code lines that did run27
Code lines that did not run27
Coverage (did run/can run)50.00 %
Function listing
   time   calls  line
1 function [allfiles, patternnum] = ml_ls( patterns )
2 % FILELISTING = ML_LS( PATTERN ) Returns file listing of wildcard PATTERN (e.g. '*.jpg').
3 % FILELISTING is a cell array of strings of filenames without path.
4 % the listing is sorted by name alphabetically
5 %
6
7 % 8/11/13 G. Johnson - modified such that pattern can be a string, or cell
8 % array of strings, in case of the need for multiple
9 % source directories
10 %
11 % Copyright (C) 2006-2013 Murphy Lab
12 % Lane Center for Computational Biology
13 % School of Computer Science
14 % Carnegie Mellon University
15 %
16 % This program is free software; you can redistribute it and/or modify
17 % it under the terms of the GNU General Public License as published
18 % by the Free Software Foundation; either version 2 of the License,
19 % or (at your option) any later version.
20 %
21 % This program is distributed in the hope that it will be useful, but
22 % WITHOUT ANY WARRANTY; without even the implied warranty of
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 % General Public License for more details.
25 %
26 % You should have received a copy of the GNU General Public License
27 % along with this program; if not, write to the Free Software
28 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 % 02110-1301, USA.
30 %
31 % For additional information visit http://murphylab.web.cmu.edu or
32 % send email to murphy@cmu.edu
33
20 34 if ~iscell(patterns)
20 35 patterns = {patterns};
20 36 end
37
20 38 allfiles = cell(length(patterns),1);
39
40 %hidden option to the user
20 41 option = 1;
42
20 43 if option == 1
20 44 for c = 1:length(patterns)
20 45 try
20 46 files = {};
0.03 20 47 list = ls( patterns{c} );
0.02 20 48 rows = strread( list, '%s', 'delimiter', ' ');
49 %rows = strread( list, '%s', 'delimiter', sprintf('\n'));
20 50 for i=1:1:length(rows)
1616 51 temp = {};
0.28 1616 52 temp = strread( rows{i},'%s','delimiter','\t');
0.01 1616 53 for j=1:1:length(temp)
1616 54 if ~isempty(temp{j})
0.02 1616 55 files{length(files)+1} = temp{j};
1616 56 end
1616 57 end
1616 58 end
59 catch
60 files = {};
61 end
62
63 %D. Sullivan 6/20/13 - added natural sorting
0.20 20 64 files = sort_nat( files );
20 65 allfiles{c} = files;
20 66 patternnum{c} = ones(1,length(files))*c;
20 67 end
68
20 69 allfiles = [allfiles{:}];
20 70 patternnum = [patternnum{:}];
71 else for c = 1:length(patterns)
72 try
73 files = {};
74 list = ls( patterns{c} );
75 rows = strread( list, '%s', 'delimiter', ' ');
76 %rows = strread( list, '%s', 'delimiter', sprintf('\n'));
77 for i=1:1:length(rows)
78 temp = {};
79 temp = strread( rows{i},'%s','delimiter','\t');
80 for j=1:1:length(temp)
81 if ~isempty(temp{j})
82 files{length(files)+1} = temp{j};
83 end
84 end
85 end
86 catch
87 files = {};
88 end
89
90 %D. Sullivan 6/20/13 - added natural sorting
91 files = sort_nat( files );
92 allfiles{c} = files;
93 patternnum{c} = ones(1,length(files))*c;
94 end
95
96 allfiles = [allfiles{:}];
97 patternnum = [patternnum{:}];
98 end
20 99 end