title: Searching for a fast/efficient histogram algorithm (with pre-specified bins)
body: <p>I don't do much coding outside of Matlab, but I have a need to export my Matlab code to another language, most likely C. My Matlab code includes a histogram function, histc(), that places my input data (which is double-precision, not integer) into a specified array of bins, to form a histogram. </p>
  
  <p>I'm sure I can piece together a couple nested loops to generate a histogram function, but I need this function to be fast and memory-light, as it will be accessed repeatedly and often.  </p>
  
  <p>To avoid re-inventing the wheel, anyone know if C language has any existing histogram function(s) available for use, or whether people needing such a thing generally create it themselves? </p>
  
  <p>Anyone know an efficient algorithm for creating a histogram? Pseudo-code is fine.</p>
  
  <p>Thanks in advance.</p>