fixed.Quantizer
Quantize fixed-point numbers
fixed.Quantizer is not recommended. Use cast, zeros, ones, eye, or subsasgn instead. For more information, see Compatibility Considerations.
Description
The fixed.Quantizer object describes data type properties to use
for quantization. After you create a fixed.Quantizer object, use
quantize to quantize fi values.
Creation
Syntax
Description
creates a quantizer
object q = fixed.Quantizerq that quantizes fixed-point numbers using the fixed-point
settings of q.
creates a fixed-point quantizer object with q = fixed.Quantizer(nt,rm,oa)numerictype
nt, rounding method rm, and overflow action
oa.
The numerictype, rounding method, and
overflow action apply only during the quantization. The output q does
not have an attached fimath.
creates a quantizer object with the property options specified by one or more property
q = fixed.Quantizer(Name,Value)Name,Value arguments.
Input Arguments
Properties
Object Functions
quantize | Quantize fi values using fixed.Quantizer
object |
Examples
More About
Tips
Use
y = quantize(q,x)to quantize input arrayxusing the fixed-point settings of the quantizer objectq.xcan be any fixed-pointfinumber, except a Boolean value. Ifxis a scaled double, thexandydata will be the same, butywill have fixed-point settings. Ifxis a double or single, theny = x. This functionality lets you share the same code for both floating-point data types and fi objects when quantizers are present.Use
n = numerictype(q)to get anumerictypefor the current settings of the quantizer objectq.Use
clone(q)to create a quantizer object with the same property values asq.
Extended Capabilities
Version History
Introduced in R2011bSee Also
quantize | fi | numerictype