| Fixed-Point Toolbox™ | ![]() |
| On this page… |
|---|
All the properties of a numerictype object are writable. However, the numerictype properties of a fi object are not writable once the fi object has been created:
Bias — Bias
DataType — Data type category
DataTypeMode — Data type and scaling mode
FixedExponent — Fixed-point exponent
SlopeAdjustmentFactor — Slope adjustment
FractionLength — Fraction length of the stored integer value, in bits
Scaling — Fixed-point scaling mode
Signed — Signed or unsigned
Slope — Slope
WordLength — Word length of the stored integer value, in bits
These properties are described in detail in the Property Reference. To learn how to specify properties for numerictype objects in Fixed-Point Toolbox™ software, refer to Setting numerictype Object Properties.
You can set properties of numerictype objects at the time of object creation by including properties after the arguments of the numerictype constructor function.
For example, to set the word length to 32 bits and the fraction length to 30 bits,
T = numerictype('WordLength', 32, 'FractionLength', 30)
T =
DataTypeMode: Fixed-point: binary point scaling
Signed: true
WordLength: 32
FractionLength: 30
You can reference directly into a property for setting or retrieving numerictype object property values using MATLAB® structure-like referencing. You do this by using a period to index into a property by name.
For example, to get the word length of T,
T.WordLength ans = 32
To set the fraction length of T,
T.FractionLength = 31
T =
DataTypeMode: Fixed-point: binary point scaling
Signed: true
WordLength: 32
FractionLength: 31
You can view and change the properties for any numerictype object defined in the MATLAB workspace in the Model Explorer. Open the Model Explorer by selecting View > Model Explorer in any Simulink® model, or by typing daexplr at the MATLAB command line.
The figure below shows the Model Explorer when you define the following numerictype objects in the MATLAB workspace:
T = numerictype
T =
DataTypeMode: Fixed-point: binary point scaling
Signed: true
WordLength: 16
FractionLength: 15
U = numerictype('DataTypeMode', 'Fixed-point: slope and bias')
U =
DataTypeMode: Fixed-point: slope and bias scaling
Signed: true
WordLength: 16
Slope: 2^-15
Bias: 0

Select the Base Workspace node in the Model Hierarchy pane to view the current objects in the Contents pane. When you select a numerictype object in the Contents pane, you can view and change its properties in the Dialog pane.
![]() | Constructing numerictype Objects | The numerictype Structure | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |