This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

float

Create Simulink.NumericType object describing floating-point data type

Syntax

a = float('single')
a = float('double')

Description

a = float('single') returns a Simulink.NumericType object that describes the data type of an IEEE® single (32 total bits, 8 exponent bits).

a = float('double') returns a Simulink.NumericType object that describes the data type of an IEEE double (64 total bits, 11 exponent bits).

Note

float is a legacy function. In new code, use fixdt instead. In existing code, replace float('single') with fixdt('single') and float('double') with fixdt('double').

Examples

Define an IEEE single data type.

>> a = float('single')
a = 

  NumericType with properties:

    DataTypeMode: 'Single'
         IsAlias: 0
       DataScope: 'Auto'
      HeaderFile: ''
     Description: ''

Introduced before R2006a