Why does MLint issue an inappropriate 'might be growing inside a loop' warning?
이전 댓글 표시
The MLint shows a 'might be growing inside a loop' warning when a finite string is concatenated with each line of a file when a loop is used to access the file line by line.
For example, if you type in the following
function lint_2007jul18(fIn, fOut)
while true
tline = fgets(fIn);
if tline == -1, break; end
if ~isempty(strfind(tline,'skip'))
tline = [ '%<skip> ' tline ];
end
fwrite(fOut,'%s', tline);
end
end
MLint shows a warning 'might be growing inside a loop'.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!