.. highlightlang:: us .. index:: histc .. _histc: histc ===== .. us.tag histc NOTREADYENGLISH New532 math-base :ref:`histc` calculates a histogram. .. function:: r = histc(v, edges) .. us.return **Return Value** *r* is a vector of length ``len(e)-1``. Each element contains the number of points that fall between the elements in the edges vector (v[i] >= edges[j] and v[i] < edges[j+1]). The last bin counts any values of v that match edges(end). Values outside the values in edges are not counted. In case of an error the function returns -1. .. us.params **Parameters** .. uparam:: v *v* is a real vector or matrix. .. uparam:: edges *edges* is a vector with bin edges. The vector must have at least two elements. The elements must be sorted monotone increasing (edges[i] < edges[i+1]). .. us.example **Example** :: * a = [1, 1.2, 1.41, 1.65, 1.66, 1.71, 1.8, 2.0] * edges = [1, 1.2, 1.4, 1.6, 1.8, 2.0] * histc(a, edges) 1 1 1 3 2 Histogram of a bitmap: :: hImg = ImageCreate("c:/test.png"); b = ImageUpdate(hImg); if (b == FALSE) error("image not found"); g = ImageGetPixelGray(hImg); r = histc(g, 0:255); plot(r); .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.3.2 - New. .. seealso:: :ref:`overview-mathematic`, :ref:`cumsum`, :ref:`histogram` :sub:`id-926486`