lundi 7 novembre 2016

Partial for-loop within if-statement

Is it possible to have the start of a for-loop within an if-statement. For example

if condition true 

    for j=1:10 

else % condition false

    for j=11:20

end % End of if-statement

    % inner part of for-loop

end % End of for-loop

I know this is not the most beautiful approach, but in some cases it might be easier than simple coding.

Oh the language is MatLab

Aucun commentaire:

Enregistrer un commentaire