MATLAB Language Support

MATLAB® language syntax and functions for HDL code generation

The MATLAB functions and language syntax supported for HDL code generation are available from this page. If your MATLAB algorithm uses an unsupported function, you can generate code by replacing the function with a lookup table approximation. See Replacing Functions Using Lookup Table Approximations.

Topics

Functions Supported for HDL Code Generation

Built-in MATLAB and toolbox functions supported for HDL code generation.

Supported MATLAB Data Types, Operators, and Control Flow Statements

Supported data types, operators, and control flow statements for HDL code generation.

Complex Data Type Support

Describes how complex signals and operations in MATLAB code map to generated HDL code.

Bitwise Operations in MATLAB for HDL Code Generation

HDL Coder™ supports bit shift, bit rotate, bit slice operations that mimic HDL-specific operators without saturation and rounding logic.

Persistent Variables and Persistent Array Variables

MATLAB persistent variable and persistent array variable language support language support for HDL code generation.

Load constants from a MAT-File

Use the coder.load function to load constants from a MAT-file.

Guidelines for Writing MATLAB Code to Generate Efficient HDL Code

Guidelines for writing efficient MATLAB code and design requirements for efficient HDL code generation.

For-Loop Best Practices for HDL Code Generation

Best practices when using for loops in your MATLAB code for HDL code generation.