| Simulink® | ![]() |
Create MATLAB® structure describing floating-point data type
a = float('single')
a = float('double')
a = float(TotalBits, ExpBits)
float('single') returns a MATLAB structure that describes the data type of an IEEE® single (32 total bits, 8 exponent bits).
float('double') returns a MATLAB structure that describes the data type of an IEEE double (64 total bits, 11 exponent bits).
float(TotalBits, ExpBits) returns a MATLAB structure that describes a nonstandard floating-point data type that mimics the IEEE style. That is, the numbers are normalized with a hidden leading one for all exponents except the smallest possible exponent. However, the largest possible exponent might not be treated as a flag for Infs and NaNs.
float is automatically called when a floating-point number is specified in a block dialog box.
Define a nonstandard, IEEE style, floating-point data type with 31 total bits (excluding the hidden leading one) and 9 exponent bits:
a = float(31,9)
a =
Class: 'FLOAT'
MantBits: 21
ExpBits: 9
fixdt, sfix, sfrac, sint, ufix, ufrac, uint
![]() | fixptbestprec | fxptdlg | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |