Hi all, I have a data file as follow:
x 0 y 1x 1.3 y 2.2x 2.2 y 6x 3.4 y 7.4
I need to read into this file, plot the data (which is done) and put the number of lines in the title of the plot. I uses the following code to get the number of lines:
count = 0;while ~feof(fid) count = count+1end
however, as it is in a while-loop, the 'count' changes every time:
count = 1count = 2count = 3count = 4
how to get a FINAL number of lines ? (aka, I want count = 4 and only =4, not varying during each time the loop running). as I need to put this 'final' number into title.
Thank you very much.
Best Answer