store which iterations that the error took place
Ältere Kommentare anzeigen
Hi everyone, I've been using try,catch and continue in my loop for any error. I was wondering is there any code that captures which iteration that error took place in the loop? so far I've put catch ME; disp(iter) to show me which iterations it is that the error took place but I can't capture them
Akzeptierte Antwort
Weitere Antworten (1)
KALYAN ACHARJYA
am 29 Aug. 2019
Bearbeitet: KALYAN ACHARJYA
am 29 Aug. 2019
l=1;
error_iter=[];
for i=1:iter
% do operation
if error %error condition
error_iter(l)=iter
l=l+1;
end
end
error_iter
1 Kommentar
JL
am 30 Aug. 2019
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!