half
Construct half-precision numeric object
Description
Use the half
constructor to assign a half-precision data type
to a number or variable. A half-precision data type occupies 16 bits of memory, but its
floating-point representation enables it to handle wider dynamic ranges than integer or
fixed-point data types of the same size. For more information, see Floating-Point Numbers (Fixed-Point Designer) and
What is Half Precision? (Fixed-Point Designer).
For a list of functions that support code generation with half-precision inputs, see Half Precision Code Generation Support.
Object Functions
These functions are supported for simulation with half-precision inputs in MATLAB®. MATLAB System object™ supports half-precision data type and MATLAB System (Simulink) block supports half-precision data type with real values. For a list of functions that support code generation with half-precision inputs, see Half Precision Code Generation Support (Fixed-Point Designer).
To display a list of supported functions, at the MATLAB Command Window, enter:
methods(half(1))
Examples
Limitations
Arithmetic operations which combine half-precision and logical types are not supported.
For additional usage notes and limitations, see Half Precision Code Generation Support.
Extended Capabilities
Version History
Introduced in R2018b
See Also
Topics
- Half Precision Code Generation Support
- Floating-Point Numbers (Fixed-Point Designer)
- What is Half Precision? (Fixed-Point Designer)
- Generate Code for Sobel Edge Detection That Uses Half-Precision Data Type