?? 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 + -