| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Fixed-Point Toolbox |
| Contents | Index |
| Learn more about Fixed-Point Toolbox |
T = numerictype
T = numerictype(s)
T = numerictype(s,w)
T = numerictype(s,w,f)
T = numerictype(s,w,slope,bias)
T = numerictype(s,w,slopeadjustmentfactor,fixedexponent,bias)
T = numerictype(property1,value1, ...)
T = numerictype(T1, property1, value1, ...)
T = numerictype('double')
T = numerictype('single')
T = numerictype('boolean')
You can use the numerictype constructor function in the following ways:
T = numerictype creates a default numerictype object.
T = numerictype(s) creates a numerictype object with Fixed-point: unspecified scaling, Signed property value s, and 16-bit word length.
T = numerictype(s,w) creates a numerictype object with Fixed-point: unspecified scaling, Signed property value s, and word length w.
T = numerictype(s,w,f) creates a numerictype object with Fixed-point: binary point scaling, Signed property value s, word length w and fraction length f.
T = numerictype(s,w,slope,bias) creates a numerictype object with Fixed-point: slope and bias scaling, Signed property value s, word length w, slope, and bias.
T = numerictype(s,w,slopeadjustmentfactor,fixedexponent,bias) creates a numerictype object with Fixed-point: slope and bias scaling, Signed property value s, word length w, slopeadjustmentfactor, fixedexponent, and bias.
T = numerictype(property1,value1, ...) allows you to set properties for a numerictype object using property name/property value pairs.
T = numerictype(T1, property1, value1, ...) allows you to make a copy of an existing numerictype object, while modifying any or all of the property values.
T = numerictype('double') creates a double numerictype.
T = numerictype('single') creates a single numerictype.
T = numerictype('boolean') creates a Boolean numerictype.
The properties of the numerictype object are listed below. These properties are described in detail in numerictype Object Properties.
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
Signedness — Signed, unsigned, or auto
Slope — Slope
WordLength — Word length of the stored integer value, in bits
Type
T = numerictype
to create a default numerictype object.
T =
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 15
The following code creates a signed numerictype object with a 32-bit word length and 30-bit fraction length.
T = numerictype(1, 32, 30)
T =
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 32
FractionLength: 30
If you omit the argument f, the scaling is unspecified.
T = numerictype(1, 32)
T =
DataTypeMode: Fixed-point: unspecified scaling
Signedness: Signed
WordLength: 32
If you omit the arguments w and f, the word length is automatically set to 16 bits and the scaling is unspecified.
T = numerictype(1)
T =
DataTypeMode: Fixed-point: unspecified scaling
Signedness: Signed
WordLength: 16
You can use property name/property value pairs to set numerictype properties when you create the object.
T = numerictype('Signed', true, ...
'DataTypeMode', 'Fixed-point: slope and bias', ...
'WordLength', 32, 'Slope', 2^-2, 'Bias', 4)
T =
DataTypeMode: Fixed-point: slope and bias scaling
Signedness: Signed
WordLength: 32
Slope: 0.25
Bias: 4
You can create a numerictype object with an unspecified sign by using property name/property values pairs to set the Signedness property to Auto.
T = numerictype('Signedness', 'Auto')
T =
DataTypeMode: Fixed-point: binary point scaling
Signedness: Auto
WordLength: 16
FractionLength: 15Note Although you can create numerictype objects with an unspecified sign (Signedness: Auto), all fi objects must have a Signedness of Signed or Unsigned. If you use a numerictype object with Signedness: Auto to construct a fi object, the Signedness property of the fi object automatically defaults to Signed. |
![]() | numberofelements | nunderflows | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |