title: Negative numbers of bins
body: <p>I have the following code that returns the values of a histogram:\</p>
  
  <pre><code>[a,b]=hist(x(:),unique(x));
  </code></pre>
  
  <p>Since I have negative values in <code>x</code>, I get for instance the value <code>-3</code>, and thus get an error, since the number of bins cannot be negative.</p>
  
  <p>What could be a workaround around this?</p>
  
  <p>Thanks.</p>