title: Matlab - input validation
body: <p>What is a good way to validate an input or exit the program with an error message altoghether?</p>
  
  <p>For example if I take an input such as</p>
  
  <pre><code>Length = input('\nEnter a length in feet: ');
  </code></pre>
  
  <p>How can I check if the number is greater than 0.</p>
  
  <p>something like</p>
  
  <pre><code>if Length &gt; 0 then 
    %%do code
  else
   %%Output error
   %%nothing to do here so it just continues and exits
  end
  </code></pre>