This is a static copy of a profile reportHome
fileread (4 calls, 0.929 sec)
Generated 05-Aug-2011 13:01:22 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/iofun/fileread.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
32 | out = fread(fid,'*char')'; | 4 | 0.929 s | 100.0% |  |
40 | fclose(fid); | 4 | 0 s | 0% |  |
30 | try | 4 | 0 s | 0% |  |
26 | if fid == (-1) | 4 | 0 s | 0% |  |
25 | [fid, msg] = fopen(filename); | 4 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.929 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 40 |
Non-code lines (comments, blank lines) | 22 |
Code lines (lines that can run) | 18 |
Code lines that did run | 8 |
Code lines that did not run | 10 |
Coverage (did run/can run) | 44.44 % |
Function listing
time calls line
1 function out=fileread(filename)
2 %FILEREAD Return contents of file as string vector.
3 % TEXT = FILEREAD('FILENAME') returns the contents of the file FILENAME as a
4 % MATLAB string.
5 %
6 % See also FREAD, TEXTSCAN, LOAD, WEB.
7
8 % Copyright 1984-2007 The MathWorks, Inc.
9 % $Revision: 1.5.4.9 $ $Date: 2010/08/23 23:10:34 $
10
11 % Validate input args
4 12 error(nargchk(1, 1, nargin, 'struct'));
13
14 % get filename
4 15 if ~ischar(filename),
16 error(message('MATLAB:fileread:filenameNotString'));
17 end
18
19 % do some validation
4 20 if isempty(filename),
21 error(message('MATLAB:fileread:emptyFilename'));
22 end
23
24 % open the file
4 25 [fid, msg] = fopen(filename);
4 26 if fid == (-1)
27 error(message('MATLAB:fileread:cannotOpenFile', filename, msg));
28 end
29
4 30 try
31 % read file
0.93 4 32 out = fread(fid,'*char')';
33 catch exception
34 % close file
35 fclose(fid);
36 throw(exception);
37 end
38
39 % close file
4 40 fclose(fid);