title: How can I loop indefinitely, but stop on some condition(s)?
body: <p>I am working on a project in MATLAB. It includes continuous plotting of a data about temperature received from the serial port of the computer. I want to do it infinitely so is there any way to create infinite loops like in C?</p>
  
  <p>Now if is implemented as:</p>
  
  <pre><code>while(true)
  %comments
  end;
  </code></pre>
  
  <p>as Moore stated below, then is there any way to update the flags so that it could be terminated as per requirement or any other operation?</p>
  
  <p>Example: I am plotting the data for my 5 nodes communicating through ZigBee then if ones I have selected to plot 4 nodes on Axis then is there any way after starting the infinite loop so that I could change the data being used inside the loop through an input method of GUI of MATLAB or any flag?</p>