is the same as
The code I gave you will let you go into the else block only when you've checked the condition 3. It works because the else is further down the code. But to go from inside the else block back up to the original if line - well that seems weird to me with this type of construct. There is no "goto" in MATLAB so you can't do that. I suggest you rethink this and try to recode this in a different way, like say maybe using functions.