0
diary_file = tempname();
diary(diary_file);
myFun();
diary('off');
output = fileread(diary_file);
strToSearch = 'variable failed'
출력 파일에서 문자열의 발생을 계산하는 알려진 함수가 있습니까?카운트 출력에서 문자열 발생 수 MATLAB
>>output = 'this sentence is a test sentence';
>>strToSearch = 'sentence';
>>numel(strfind(output,strToSearch))
ans =
2
strfind
당신에게 추구 문자열 (strToSearch
가) 텍스트 (output
) 내에있는 시작하는 인덱스를 말한다;