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); endend
Best Answer