title: warning: Matlab-style short-circuit operation performed for operator &
body: <p>Code:</p>
  
  <pre><code>if (round(xw(1))&gt;2) &amp; (round(xw(2))&gt;2) &amp; (round(xw(1))&lt;h-1) &amp; (round(xw(2))&lt;w-1)
          W0 = img(round(xw(1))-2:round(xw(1))+2,round(xw(2))-2:round(xw(2))+2);
  else
          NA=1;
          break
  endif
  </code></pre>
  
  <p><code>xw</code> is a column vector which contains the co-ordinates of a point.
  <code>h</code> and <code>w</code> are the dimensions of an image.</p>
  
  <p>I am using these lines of codes in <strong>OCTAVE</strong></p>
  
  <p>But when I run the function which contains these lines I get a warning</p>
  
  <p><code>warning: Matlab-style short-circuit operation performed for operator &amp;</code></p>
  
  <p>Is it that in spite of using <code>&amp;</code>, <strong>octave</strong> is performing <code>&amp;&amp;</code> operation?</p>
  
  <p>I learnt that if I use <code>&amp;&amp;</code> then depending on the first statement is <code>True</code> or <code>False</code>, the next statements are evaluated.</p>
  
  <p>So, is this what is happening when I get this warning? What is the solution to this problem then?</p>
  
  <p>I want to check if all the statements are <code>True</code> and not just the first one.</p>