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.

Examples and How To

Replace a Custom Function with a Lookup Table

With HDL Coder™, you can generate lookup table approximations for functions that do not support fixed-point types, and replace your own functions.

Replace the exp Function with a Lookup Table

With HDL Coder, you can handle functions that are not supported for fixed point and replace your own functions.

Load constants from a MAT-File

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

Concepts

MATLAB Language

Functions Supported for HDL Code Generation — Alphabetical List

You can generate efficient HDL code for a subset of MATLAB built-in functions and toolbox functions that you call from MATLAB code.

Functions Supported for HDL Code Generation — Categorical List

You can generate efficient HDL code for a subset of MATLAB built-in functions and toolbox functions that you call from MATLAB code.

Data Types and Scope

MATLAB data type and scope support for HDL code generation

Operators

MATLAB operator language support for HDL code generation

Control Flow Statements

MATLAB control flow statement language support for HDL code generation

Persistent Variables

MATLAB persistent variable language support for HDL code generation

Persistent Array Variables

MATLAB persistent array variable language support for HDL code generation

Complex Data Type Support

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

System Objects

Fixed Point

Fixed-Point Bitwise Functions

Generating HDL code for MATLAB fixed-point bitwise functions

Fixed-Point Run-Time Library Functions

Fixed-point run-time library function language support for HDL code generation

Replacing Functions Using Lookup Table Approximations

The Fixed-Point Designer™ MATLAB Coder™ software provides an option to generate lookup table approximations for continuous and stateless single-input, single-output functions in your original MATLAB code.

Was this topic helpful?