matlabquantizer函数⽤法,Constructquantizerobject-。。。quantizer
笔记怎么写Construct quantizer object
Syntax
q = quantizer
q = quantizer('PropertyName1',PropertyValue1,...)
q = quantizer(PropertyValue1,PropertyValue2,...)
q = quantizer(struct)
q = quantizer(pn,pv)
Description
q = quantizer creates a quantizer object
with properties t to their default values. To u this object to
quantize values, u the quantize method.
q = quantizer('PropertyName1',PropertyValue1,...) us
property name/ property value pairs.水痘潜伏期
q = quantizer(PropertyValue1,PropertyValue2,...) creates
a quantizer object with the listed property values.
When two values conflict, quantizer ts the last村官面试题
property value in the list. Property values are unique; you can t
董鄂妃the property names by specifying just the property values in the command.
q = quantizer(struct), where struct is
a structure who field names are property names, ts the properties
萝莉什么意思named in each field name with the values contained in the structure.
q = quantizer(pn,pv) ts the named properties
specified in the cell array of character vectors pn to怪味胡豆的做法
the corresponding values in the cell array pv.
The quantizer object property values are
listed below. The properties are described in detail in quantizer Object Properties.
Property NameProperty ValueDescriptionmode'double'Double-precision mode. Override all other parameters.
'float'Custom-precision floating-point mode.
'fixed'Signed fixed-point mode.
'single'Single-precision mode. Override all other parameters.
'ufixed'Unsigned fixed-point mode.
roundmode'ceil'Round toward positive infinity.
'convergent'Round to nearest integer with ties rounding to nearest
even integer.
'fix'Round toward zero.
'floor'Round toward negative infinity.
'Nearest'Round to nearest integer with ties rounding toward positive
宝宝识数字infinity.
'Round'Round to nearest integer with ties rounding to nearest
integer with greater absolute value.
overflowmode (fixed-point
only)'saturate'Saturate on overflow.
'wrap'Wrap on overflow.
format[wordlength fractionlength]Format for fixed or ufixed mode.
[wordlength exponentlength]Format for float mode.
The default property values for a quantizer object
are
DataMode = fixed
RoundMode = floor
OverflowMode = saturate
Format = [16 15]
Along with the preceding properties, quantizer objects
have read-only states: max, min, noverflows, nunderflows,
and noperations. They can be accesd through quantizer/get or q.maxlog, q.minlog, q.noverflows, q.nunderflows, perations, but they cannot be t. They
are updated during the quantizer/quantize method,
and are ret by the retlog function.
The following table lists the read-only quantizer object
states:
Property NameDescriptionmaxMaximum value before quantizing
minMinimum value before quantizing学习名言
noverflowsNumber of overflows
nunderflowsNumber of underflows
noperationsNumber of data points quantized
Examples
The following example operations are equivalent.
Setting quantizer object properties by listing
property values only in the command,
q = quantizer('fixed', 'Ceiling', 'Saturate', [5 4])
Using a structure struct to t quantizer object
properties,
struct.overflowmode = 'saturate';
struct.format = [5 4];
q = quantizer(struct);
Using property name and property value cell arrays pn and pv to
t quantizer object properties,
pn = {'mode', 'roundmode', 'overflowmode', 'format'};
pv = {'fixed', 'ceil', 'saturate', [5 4]};
q = quantizer(pn, pv)
Using property name/property value pairs to configure a quantizer object, q = quantizer( 'mode', 'fixed','roundmode','ceil',...
'overflowmode', 'saturate', 'format', [5 4]);
Introduced before R2006a