Documentation

Contents

fixdt

Create Simulink.NumericType object describing fixed-point or floating-point data type

Syntax

a = fixdt(Signed, WordLength)
a = fixdt(Signed, WordLength, FractionLength)
a = fixdt(Signed, WordLength, TotalSlope, Bias)
a = fixdt(Signed, WordLength, SlopeAdjustmentFactor, FixedExponent, Bias)
a = fixdt(DataTypeNameString)
a = fixdt(..., 'DataTypeOverride', 'Off')
[DataType,IsScaledDouble] = fixdt(DataTypeNameString)
[DataType,IsScaledDouble] = fixdt(DataTypeNameString, 'DataTypeOverride', 'Off')

Description

a = fixdt(Signed, WordLength) returns a Simulink.NumericType object describing a fixed-point data type with unspecified scaling. The scaling would typically be determined by another block parameter. Signed can be 0 (false) for unsigned or 1 (true) for signed.

a = fixdt(Signed, WordLength, FractionLength) returns a Simulink.NumericType object describing a fixed-point data type with binary point scaling. FractionLength can be greater than WordLength. For more information, see Binary Point Interpretation.

a = fixdt(Signed, WordLength, TotalSlope, Bias) or a = fixdt(Signed, WordLength, SlopeAdjustmentFactor, FixedExponent, Bias) returns a Simulink.NumericType object describing a fixed-point data type with slope and bias scaling.

a = fixdt(DataTypeNameString) returns a Simulink.NumericType object describing an integer, fixed-point, or floating-point data type specified by a data type name. The data type name can be either the name of a built-in Simulink® data type or the name of a fixed-point data type that conforms to the naming convention for fixed-point names established by the Fixed-Point Designer™ product. For more information, see Fixed-Point Data Type and Scaling Notation in the Fixed-Point Designer documentation.

a = fixdt(..., 'DataTypeOverride', 'Off') returns a Simulink.NumericType object with its DataTypeOverride parameter set to Off. The default value for this property is Inherit. You can specify the DataTypeOverride parameter after any combination of other input parameters.

[DataType,IsScaledDouble] = fixdt(DataTypeNameString) returns a Simulink.NumericType object describing an integer, fixed-point, or floating-point data type specified by a data type name and a flag that indicates whether the specified data type name was the name of a scaled double data type.

[DataType,IsScaledDouble] = fixdt(DataTypeNameString, 'DataTypeOverride', 'Off') returns:

  • A Simulink.NumericType object describing an integer, fixed-point, or floating-point data type specified by a data type name. The DataTypeOverride parameter of the Simulink.NumericType object is set to Off.

  • A flag that indicates whether the specified data type name was the name of a scaled double data type.

Examples

Return a Simulink.NumericType object describing a fixed-point data type with unspecified scaling:

a = fixdt(1,16)

a =
 
Simulink.NumericType
    DataTypeMode: 'Fixed-point: unspecified scaling'
      Signedness: 'Signed'
      WordLength: 16
         IsAlias: false
      HeaderFile: ''
     Description: ''

Return a Simulink.NumericType object describing a fixed-point data type with binary point scaling :

a = fixdt(1,16,2)

a =
 
Simulink.NumericType
    DataTypeMode: 'Fixed-point: binary point scaling'
      Signedness: 'Signed'
      WordLength: 16
  FractionLength: 2
         IsAlias: false
      HeaderFile: ''
     Description: ''

Return a Simulink.NumericType object describing a fixed-point data type with slope and bias scaling:

a = fixdt(1, 16, 2^-2, 4)
 
a =
 
Simulink.NumericType
    DataTypeMode: 'Fixed-point: slope and bias scaling'
      Signedness: 'Signed'
      WordLength: 16
           Slope: 0.25
            Bias: 4
         IsAlias: false
      HeaderFile: ''
     Description: ''

Return a Simulink.NumericType object describing an integer, fixed-point, or floating-point data type specified by a data type name:

[DataType,IsScaledDouble] = fixdt('ufix8')
 
DataType =
 
Simulink.NumericType
    DataTypeMode: 'Fixed-point: binary point scaling'
      Signedness: 'Unsigned'
      WordLength: 8
  FractionLength: 0
         IsAlias: false
      HeaderFile: ''
     Description: ''
IsScaledDouble =

     0

Return a Simulink.NumericType object with its DataTypeOverride property set to Off:

 a = fixdt(0, 8, 2, 'DataTypeOverride', 'Off')
 
a =
 
Simulink.NumericType
    DataTypeMode: 'Fixed-point: binary point scaling'
      Signedness: 'Unsigned'
      WordLength: 8
  FractionLength: 2
DataTypeOverride: Off
         IsAlias: false
      HeaderFile: ''
     Description: ''

See Also

| | | | | |

Was this topic helpful?