📄 linecount.m
字号:
function lc = linecount(filename)%LINECOUNT Count the number of lines in given file%% LC = LINECOUNT(FILENAME) Returns LC, the number of% lines in text file named FILENAME, or 0 if the file% does not exist or is not readable.% Matthew Dailey 2000 fid = fopen(filename,'r'); if fid < 0 lc = 0; else lc = 0; while 1 ln = fgetl(fid); if ~isstr(ln) break; end; lc = lc + 1; end; fclose(fid); end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -