2%> Return a scalar MATLAB integer representing
3%> the number of lines in the specified input ``idname``.
5%> \param[in] idname : The input scalar MATLAB
object that can be either:<br>
7%> <li> a MATLAB
string containing the path
8%> to a record-based external file whose
9%> number of records (lines) must be returned.<br>
10%> <li> a MATLAB integer, representing the file
11%> ID of an opened record-based file whose
12%> number of records (lines) must be returned.<br>
16%> ``nlines`` : The output scalar MATLAB integer containing the
17%> number of records (lines) in the specified input ``idname``.
22%> nlines = pm.io.numlines(idname);
27%> The input file (ID) will be closed even
if it is open upon entry to the function.
30%> \include{lineno} example/io/
numlines/main.m
32%> \include{lineno} example/io/
numlines/main.out.m
37%> \JoshuaOsborne, May 21 2024, 5:50 PM, University of Texas at Arlington<br>
38%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
39%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
41 if pm.introspection.istype(idname,
"string", 1)
42 [fid, errmsg] = fopen(idname,
'r');
44 help(
"pm.io.numlines");
46 +
"Failed to open file """ + idname +
""": " + newline ...
48 +
string(errmsg) + newline ...
50 +
"For more information, see the documentation of the function displayed above." + newline ...
54 elseif pm.introspection.istype(idname,
"integer", 1)
57 help(
"pm.io.numlines");
61 +
"Invalid input value for ``idname`` displayed above." + newline ...
62 +
"For more information, see the documentation of the function displayed above." + newline ...
function numlines(in idname)
Return a scalar MATLAB integer representing the number of lines in the specified input idname.