This is a static copy of a profile report

Home

profsave (1 call, 0.000 sec)
Generated 15-Mar-2007 12:02:10 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\codetools\profsave.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)
No parent
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
19
profInfo = profile('info');
10 s0%
18
if nargin < 1
10 s0%
Other lines & overhead  0 s0%
Totals  0.000 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
profileM-function10 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0.000 s0% 
M-Lint results
Line numberMessage
26The value assigned here to variable 'nm' might never be used.
Coverage results
[ Show coverage for parent directory ]
Total lines in file67
Non-code lines (comments, blank lines)31
Code lines (lines that can run)36
Code lines that did run2
Code lines that did not run34
Coverage (did run/can run)5.56 %
Function listing
   time   calls  line
1 function profsave(profInfo, dirname)
2 %PROFSAVE Save a static version of the HTML profile report
3 % PROFSAVE(PROFINFO) saves HTML files that correspond to each of the
4 % files in the profiler data structure's FunctionTable.
5 % PROFSAVE(PROFINFO, DIRNAME) saves the files in the specified directory
6 % PROFSAVE by itself uses the results from the call PROFILE('INFO')
7 %
8 % Example:
9 % profile on
10 % plot(magic(5))
11 % profile off
12 % profsave(profile('info'),'profile_results')
13 %
14 % See also PROFILE, PROFVIEW.
15
16 % Copyright 1984-2004 The MathWorks, Inc.
17
1 18 if nargin < 1
1 19 profInfo = profile('info');
20 end
21
22 if nargin < 2
23 dirname = 'profile_results';
24 end
25
26 [pth,nm] = fileparts(dirname);
27
28 if isempty(pth)
29 fullDirname = fullfile(cd,dirname);
30 else
31 fullDirname = dirname;
32 end
33
34
35 if ~exist(fullDirname,'dir')
36 [success, message] = mkdir(fullDirname);
37 if ~success
38 error(message)
39 return
40 end
41 end
42
43 for n = 0:length(profInfo.FunctionTable)
44 str = profview(n,profInfo);
45
46 str = regexprep(str,'<a href="matlab: profview\((\d+)\);">','<a href="file$1.html">');
47 % The question mark makes the .* wildcard non-greedy
48 str = regexprep(str,'<a href="matlab:.*?>(.*?)</a>','$1');
49 % Remove all the forms
50 str = regexprep(str,'<form.*?</form>','');
51
52 insertStr = ['<body bgcolor="#F8F8F8"><strong>This is a static copy of a profile report</strong><p>' ...
53 '<a href="file0.html">Home</a><p>'];
54 str = strrep(str,'<body>',insertStr);
55
56 filename = fullfile(fullDirname,sprintf('file%d.html',n));
57 fid = fopen(filename,'w');
58 if fid > 0
59 fprintf(fid,'%s',str);
60 fclose(fid);
61 else
62 error('Can''t open file')
63 end
64
65 end
66
67 web(['file:///' fullfile(fullDirname,'file0.html')],'-browser');