Main Content

numerictype of Fixed-Point Objects

Valid Values fornumerictypeObject Properties

Thenumerictypeobject contains all the data type and scaling attributes of a fixed-point object. Thenumerictypeobject behaves like any MATLAB®object, except that it only lets you set valid values for defined fields. The following table shows the possible settings of each field of the object.

Note

When you create afiobject, any unspecified field of thenumerictypeobject reverts to its default value. Thus, if theDataTypeModeis set tounspecified scaling,它默认为binary point scalingwhen thefiobject is created. If theSignednessproperty of thenumerictypeobject is set toAuto,它默认为Signedwhen thefiobject is created.

DataTypeMode DataType Scaling Signedness Word-
Length
Fraction-
Length
Slope Bias

Fixed-point data types

Fixed-point: binary point scaling

Fixed

BinaryPoint

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

积极或否定ative integer

2^(-fraction length)

0

Fixed-point: slope and bias scaling

Fixed

SlopeBias

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

N/A

Any floating- point number greater than zero

Any floating- point number

Fixed-point: unspecified scaling

Fixed

Unspecified

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

N/A

N/A

N/A

Scaled double data types

Scaled double: binary point scaling

ScaledDouble

BinaryPoint

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

积极或否定ative integer

2^(-fraction length)

0

Scaled double: slope and bias scaling

ScaledDouble

SlopeBias

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

N/A

Any floating- point number greater than zero

Any floating- point number

Scaled double: unspecified scaling

ScaledDouble

Unspecified

Signed
Unsigned
Auto

Positive integer from 1 to 65,535

N/A

N/A

N/A

Built-in data types

Double

double

N/A

1
true

64

0

1

0

Single

single

N/A

1
true

32

0

1

0

Boolean

boolean

N/A

0
false

1

0

1

0

You cannot change thenumerictypeproperties of afiobject afterfiobject creation.

Properties That Affect the Slope

TheSlopefield of thenumerictypeobject is related to theSlopeAdjustmentFactorandFixedExponentproperties by

s l o p e = s l o p e a d j u s t m e n t f a c t o r × 2 f i x e d e x p o n e n t

TheFixedExponentandFractionLengthproperties are related by

f i x e d e x p o n e n t = f r a c t i o n l e n g t h

If you set theSlopeAdjustmentFactor,FixedExponent, orFractionLengthproperty, theSlopefield is modified.

Stored Integer Value and Real World Value

In binary point scaling thenumerictypeStoredIntegerValueandRealWorldValueproperties are related according to

r e a l - w o r l d v a l u e = s t o r e d i n t e g e r v a l u e × 2 - f r a c t i o n l e n g t h

In [Slope Bias] scaling theRealWorldValuecan be represented by

r e a l - w o r l d v a l u e = s t o r e d i n t e g e r v a l u e × ( s l o p e a d j u s t m e n t f a c t o r × 2 f i x e d e x p o n e n t ) + b i a s

which is equivalent to

r e a l - w o r l d v a l u e = ( s l o p e × s t o r e d i n t e g e r ) + b i a s

If any of these properties are updated, the others are modified accordingly.

Related Topics