This is a static copy of a profile report

Home

Function details for fgetlThis is a static copy of a profile report

Home

fgetl (Calls: 14, Time: 0.002 s)
Generated 19-Jun-2021 04:39:09 using performance time.
function in file /nfs/linux/matlab-2019b/toolbox/matlab/iofun/fgetl.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
read_configfunction14
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
32
[tline,lt] = fgets(fid);
140.001 s43.9%
33
tline = tline(1:end-length(lt)...
140.001 s27.6%
35
tline = '';
10.000 s7.7%
38
end
140.000 s0.5%
34
if isempty(tline)
140.000 s0.3%
All other lines  0.000 s19.9%
Totals  0.002 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)31
Code lines (lines that can run)7
Code lines that did run7
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
   1 
function tline = fgetl(fid)
   2 
%FGETL Read line from file, discard newline character.
   3 
%   TLINE = FGETL(FID) returns the next line of a file associated with file
   4 
%   identifier FID as a MATLAB character vector. The line terminator is NOT included.
   5 
%   Use FGETS to get the next line with the line terminator INCLUDED. If just an
   6 
%   end-of-file is encountered, -1 is returned.
   7 
%
   8 
%   If an error occurs while reading from the file, FGETL returns an empty character
   9 
%   vector. Use FERROR to determine the nature of the error.
  10 
%
  11 
%   MATLAB reads characters using the encoding scheme associated with the file. See
  12 
%   FOPEN for more information.
  13 
%
  14 
%   FGETL is intended for use with files that contain newline characters. Given a
  15 
%   file with no newline characters, FGETL may take a long time to execute.
  16 
%
  17 
%   Example
  18 
%       fid=fopen('fgetl.m');
  19 
%       while 1
  20 
%           tline = fgetl(fid);
  21 
%           if ~ischar(tline), break, end
  22 
%           disp(tline)
  23 
%       end
  24 
%       fclose(fid);
  25 
%
  26 
%   See also FGETS, FOPEN, FERROR.
  27 

  28 
%   Copyright 1984-2016 The MathWorks, Inc.
  29 

< 0.001 
     14 
  30
narginchk(1,1) 
  31 

  0.001 
     14 
  32
[tline,lt] = fgets(fid); 
< 0.001 
     14 
  33
tline = tline(1:end-length(lt)); 
< 0.001 
     14 
  34
if isempty(tline) 
< 0.001 
      1 
  35
    tline = ''; 
< 0.001 
     14 
  36
end 
  37 

< 0.001 
     14 
  38
end 

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