title: Jump to next statement within if statement in Matlab
body: <p>I know this is very bad programming style, but I need it now quick. </p>
  
  <p>What I need is a jump to the "else" from within the elseif without running the whole code <em>tons of calculating code</em> again. Anybody an idea how to?</p>
  
  <p>I can't rewrite the whole structure, nor do I want to write a subfunction which calls the else calculation in the if statement2 because it is quite a calculation which needs tons of input elements.</p>
  
  <p>My quick and dirty solution has to run the whole tons of calculation again: </p>
  
  <pre><code>flag = 0; 
  
  while a&gt;1
     *tons of calculating code*
  
    if statement1
  
     *random calculation*
  
    elseif flag==0
  
      *calculation*
  
      if statement2 %Depends on whats happening in *calculation*
         flag = 1;
         continue
      end
  
    else 
    flag = 0;
    *calculations*
    end
  
  end
  </code></pre>
  
  <p>Best regards :)</p>