MATLAB: How not to repeat the whole code after the try catch loop

for looplooploopssolve

Hi all
is there a line to indicate the main code between the try catch loop to avoide rewriting it ?

Best Answer

A bold guess, which contains at least the terms "loop" and "try catch" and "avoid rewriting it":
ready = false;
while ~ready
try
executeTheCode;
ready = true;
catch ME
fprintf('%s\ntrying it again...\n', ME.message);
end
end