title: MATLAB logical operators: && vs &
body: <p>If I want to ensure that an <code>if</code> statement only executes if BOTH of two conditions are true, should I be using <code>&amp;</code> or <code>&amp;&amp;</code> between the clauses of the statement?</p>
  
  <p>For example, should I use</p>
  
  <pre><code>if a == 5 &amp; b == 4
  </code></pre>
  
  <p>or </p>
  
  <pre><code>if a == 5 &amp;&amp; b == 4
  </code></pre>
  
  <p>I understand that the former is elementwise and the latter is capable of short-circuiting but am not clear on what this means.</p>