title: How to check in MATLAB if a vector only contains zeros?
body: <p>What is the "MATLAB-way" to check if a vector only contains zeros, so that it will be evaluated to a scalar rather than to a vector. If I run this code:</p>
  
  <pre><code>vector = zeros(1,10)
  
  %the "1" represents a function that returns a scalar
  if 1 &amp;&amp; vector == 0   %this comparision won't work
      'success'
  end
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>??? Operands to the || and &amp;&amp;
    operators must be convertible to
    logical scalar values.</p>
  </blockquote>