MATLAB: Is it possible to restart loops in MATLAB 7.6 (R2008a)

initializeMATLABre-initializereinitialize

I would like to have a function that restarts a loop in MATLAB.
For instance:
for i=1:10
restart
%This should start the loop over again with i=1
end

Best Answer

The ability to restart FOR loops is not available in MATLAB 7.6 (R2008a).
As a workaround, instead of a FOR loop, use a WHILE loop as follows:
i = 1;
while (i <= 10)
% Statements
% ...
i = i + 1;
if (condition)
i = 1;
end
end