This is a static copy of a profile report

Home

fileread (Calls: 1, Time: 0.007 s)
Generated 18-May-2021 16:05:21 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/iofun/fileread.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...p>HelpTopicMap.retrieveHelpTargetsclass method1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
27
out = fread(fid,'*char')';
10.006 s82.6%
21
[fid, msg] = fopen(filename);
10.000 s4.8%
33
fclose(fid);
10.000 s3.9%
11
filename = convertStringsToCha...
10.000 s2.8%
31
end
10.000 s0.0%
All other lines  0.000 s5.9%
Totals  0.007 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function33
Non-code lines (comments, blank lines)14
Code lines (lines that can run)19
Code lines that did run13
Code lines that did not run6
Coverage (did run/can run)68.42 %
Function listing
time 
Calls 
 line
   1 
function out=fileread(filename)
   2 
%FILEREAD Return contents of file as a character vector.
   3 
%   TEXT = FILEREAD(FILENAME) returns the contents of the file FILENAME.
   4 
%
   5 
%   See also FREAD, TEXTSCAN, LOAD, READTABLE, UIIMPORT, IMPORTDATA
   6 

   7 
% Copyright 1984-2018 The MathWorks, Inc.
   8 

      1 
   9
narginchk(1, 1); 
  10 

< 0.001 
      1 
  11
filename = convertStringsToChars(filename); 
  12 

      1 
  13
if ~ischar(filename) 
  14 
    error(message('MATLAB:fileread:filenameNotString')); 
      1 
  15
end 
  16 

      1 
  17
if isempty(filename) 
  18 
    error(message('MATLAB:fileread:emptyFilename')); 
      1 
  19
end 
  20 

< 0.001 
      1 
  21
[fid, msg] = fopen(filename); 
      1 
  22
if fid == -1 
  23 
    error(message('MATLAB:fileread:cannotOpenFile', filename, msg));
      1 
  24
end 
  25 

< 0.001 
      1 
  26
try 
  0.006 
      1 
  27
    out = fread(fid,'*char')'; 
  28 
catch exception
  29 
    fclose(fid);
  30 
    throw(exception);
< 0.001 
      1 
  31
end 
  32 

< 0.001 
      1 
  33
fclose(fid); 

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