Produce histogram counts.
n = nan_histc(y,edges); n = nan_histc(y,edges,dim) [n,idx] = nan_histc (...)
When y is a vector, the function counts the number of elements of y that fall in the histogram bins defined by edges. This must be a vector of monotonically non-decreasing values that define the edges of the histogram bins. So, n(k) contains the number of elements in y for which edges(k) <= y < edges(k+1). The final element of n contains the number of elements of y that was equal to the last element of edges.
When y is a N-dimensional array, the same operation as above is repeated along dimension dim. If this argument is given, the operation is performed along the first non-singleton dimension.
If a second output argument is requested an index matrix is also returned. The idx matrix has same size as y. Each element of idx contains the index of the histogram bin in which the corresponding element of y was counted.