title: In a script, how to known if Matlab is running in Interactive (trough emacs) or in Batch?
body: <p>In my Matlab script I would like to discriminate the case where the script is run in Interactive trough emacs matlab mode or in Batch.</p>
  
  <p>By running in Batch I mean running as explained on Matlab website here <a href="http://www.mathworks.com/support/solutions/en/data/1-15HNG" rel="nofollow">http://www.mathworks.com/support/solutions/en/data/1-15HNG</a>.</p>
  
  <p>For example trough a variable for doing think like this:</p>
  
  <pre><code>if (SCRIPT_RUNNING_IN_BATCH==1)
    do_this;
  end
  </code></pre>
  
  <p>Is there a way to doing this?</p>