필터 지우기
필터 지우기

How to write error information into a file

조회 수: 3 (최근 30일)
Jason
Jason 2016년 3월 9일
답변: Walter Roberson 2016년 3월 9일
For the following code, if we catch a error, how do I do so that the error information('Inconsistent data in iteration %s, skipped.\n', i) can be write into a file(e.g.)? So after code finish running, I can open the file to check the error information.
for i=1:100
try
NonData=[Weight;Height;Age];
% do something with your NonData
catch
fprintf('Inconsistent data in iteration %s, skipped.\n', i);
end
end

채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 9일
Consider diary()
Over the longer term, fopen a file and fprintf to the file identifier.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by