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

MATLAB Functions and Operators

Functions Supported for HDL Code Generation — Alphabetical List

Alphabetical list of built-in MATLAB and toolbox functions supported for HDL code generation.

Functions Supported for HDL Code Generation — Categorical List

Categorical list of 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.

Persistent Variables and Persistent Array Variables

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

Hexadecimal and Binary Values (MATLAB)

Specify hexadecimal and binary values either as literals or as text. Hexadecimal and binary literals are stored as integers. You can convert text representing hexadecimal and binary values to numbers, and numbers to text representations.

Complex Data Type Support

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

Load constants from a MAT-File

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

Signal Processing Algorithms

HDL Code Generation for LMS Filter

This example shows how to generate HDL code from a MATLAB® design that implements an LMS filter.

Bisection Algorithm to Calculate Square Root of an Unsigned Fixed-Point Number

This example shows how to generate HDL code from MATLAB® design implementing an bisection algorithm to calculate the square root of a number in fixed point notation.

Communications Algorithms

Timing Offset Estimation

This example shows how to generate HDL code from a basic lead-lag timing offset estimation algorithm implemented in MATLAB® code.

Data Packetization

This example shows how to generate HDL code from a MATLAB® design that packetizes a transmit sequence.

Transmit and Receive FIFO

This example shows how to generate HDL code from MATLAB® code modeling transfer data between transmit and receive FIFO.

Image Processing Algorithms

HDL Code Generation for Harris Corner Detection Algorithm

This example shows how to generate HDL code from a MATLAB® design that computes the corner metric by using Harris' technique.

HDL Code Generation for Adaptive Median Filter

This example shows how to generate HDL code from a MATLAB® design that implements an adaptive median filter algorithm and generates HDL code.

Contrast Adjustment

This example shows how to generate HDL code from a MATLAB® design that adjusts image contrast by linearly scaling pixel values.

Featured Examples