Obviously one could loop through a file using fgetl or similar function and increment a counter, but is there a way to determine the number of lines in a file without
You can read the entire file at once, and then count how many lines you've read.
fid = fopen('yourFile.ext'); allText = textscan(fid,'%s','delimiter','\n'); numberOfLines = length(allText{1}); fclose(fid)