MATLAB: For with Break

breakforMATLAB

Hi all.Please Help me.
How I can use for with break. "
for i=1:n;
%action
if H == 1 ; break
end
end

Best Answer

Seems like you've got the right idea:
for n=1:100
disp(n)
if n == 7
disp('Hello everybody')
break
end
end