📄 countdlm.m
字号:
% function count = countdlm(filename,dlm)
%
% Counts number of delimetrs on first line
function count = countdlm(filename,dlm)
eol = 10;
count=0;
file = fopen(filename);
if file ~= -1
l = fgets(file); % Obtain entire string of labels
ie=1; % end index of current string
finished = 0; % flag to detect when end of line is reached
while(finished == 0)
while (l(ie) ~= dlm) & (l(ie) ~= eol) % find next delimeter
ie = ie+1;
end
if l(ie)==dlm
count = count+1;
end
if l(ie)==eol
finished = 1;
end
ie=ie+1;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -