Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan 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

Was this topic helpful?