function myFileRW(input)
% 确定此文件有多少行(numline)
fid = fopen(input,'r');
numline = 0;
disp('total line')
fid
while feof(fid) ~= 1
currentLine = fgetl(fid);
numline = numline + 1;
end
fclose(fid);
fid = fopen(input,'r');
numline = 0;
while feof(fid) ~= 1
currentLine = fgetl(fid);
sprintf('Show the line of NO. %d',numline)
currentLine
numline = numline + 1;
end
fclose(fid);
No comments:
Post a Comment