assign2bins

PURPOSE ^

Quantizes I according to values in edges.

SYNOPSIS ^

function B = assign2bins( I, edges )

DESCRIPTION ^

 Quantizes I according to values in edges.  

 assign2bins replaces each value in I with a value between [0,nbins] where
 nbins=length(edges)-1.  edges must be a vector of monotonically increasing values.  Each
 element v in I gets converted to a discrete value q such that edges(q)<=v< edges(q+1).
 If v==edges(end) then q=nbins.  If v does not fall into any bin, then q=0. 

 See histc_1D for more details about edges and nbins. 

 INPUTS
   I           - numeric array of arbitrary dimension
   edges       - either nbins+1 length vector of quantization bounds, or scalar nbins

 OUTPUTS
   B           - size(I) array of quantization levels, int values between [0,nbins]

 EXAMPLE
   I = rand(5,5)
   B = assign2bins(I,[0:.1:1])

 DATESTAMP
   29-Sep-2005  2:00pm
   
 See also HISTC_1D

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 03-May-2006 23:48:50 by m2html © 2003