| 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, signedness s, and 16-bit word length.
T = numerictype(s,w) creates a numerictype object with Fixed-point: unspecified scaling, signedness s, and word length w.
T = numerictype(s,w,f) creates a numerictype object with Fixed-point: binary point scaling, signedness 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, signedness 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, signedness 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
Slope — Slope
WordLength — Word length of the stored integer value, in bits
Type
T = numerictype
to create a default numerictype object.
T =
DataType: Fixed
Scaling: BinaryPoint
Signed: true
WordLength: 16
FractionLength: 15
The following 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
Signed: true
WordLength: 32
FractionLength: 30
If you omit the argument f, the scaling is unspecified.
T = numerictype(1, 32)
T =
DataTypeMode: Fixed-point: unspecified scaling
Signed: true
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
Signed: true
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
Signed: true
WordLength: 32
Slope: 0.25
Bias: 4
![]() | numberofelements | nunderflows | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |