(To be removed) Histogram of input or sequence of inputs
The Histogram
object generates a histogram for an input
or a sequence of inputs.
The dsp.Histogram
System
object™ will be removed in a future release. Use the histcounts
function instead. For more information, see Compatibility Considerations.
To generate a histogram for an input or a sequence of inputs:
Create the dsp.Histogram
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
returns a histogram
object, hist
= dsp.Histogramhist
, that computes the frequency distribution of the
elements in each input matrix.
returns a histogram object, hist
= dsp.Histogram(min
,max
,numbins
)hist
, with the
LowerLimit
property set to min
,
UpperLimit
property set to max
, and
NumBins
property set to numbins
.
hist = dsp.Histogram(
returns a
histogram object, Name,Value
)hist
, with each specified property set
to the specified value. Enclose each property name in single quotes. Unspecified
properties have default values.
To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named obj
, use
this syntax:
release(obj)
Note: If you are using R2016a or an
earlier release, replace each call to the object with the equivalent step
syntax. For example, obj(x)
becomes
step(obj,x)
.
Compute a histogram with four bins, for possible input values 1 through 4.
hist = dsp.Histogram(1,4,4); y = hist([1 2 2 3 3 3 4 4 4 4]')
y = 4×1
1
2
3
4
This object implements the algorithm, inputs, and outputs described on the Histogram block reference page. The object properties correspond to the block parameters, except:
The Reset port block parameter corresponds to both the ResetCondition
and the ResetInputPort
object properties.
The Find histogram over block parameter corresponds to the Dimension property of the object.