MATLAB Examples

Accelerate fixed-point algorithms using fiaccel function. You generate a MEX function from MATLAB® code, run the generated MEX function, and compare the execution speed with MATLAB code

Convert a textbook version of the Fast Fourier Transform (FFT) algorithm into fixed-point MATLAB® code.

Convert a finite impulse-response (FIR) filter to fixed point by separating the fixed-point type specification from the algorithm code.

Set fixed-point data types by instrumenting MATLAB® code for min/max logging and using the tools to propose data types.

Compute square root using a CORDIC kernel algorithm in MATLAB®. CORDIC-based algorithms are critical to many embedded applications, including motor controls, navigation, signal

Use the CORDIC algorithm, polynomial approximation, and lookup table approaches to calculate the fixed-point, four quadrant inverse tangent. These implementations are approximations

Use both CORDIC-based and lookup table-based algorithms provided by the Fixed-Point Designer™ to approximate the MATLAB® sine (SIN) and cosine (COS) functions. Efficient fixed-point

Write MATLAB® code that works for both floating-point and fixed-point data types. The algorithm used in this example is the QR factorization implemented via CORDIC (Coordinate Rotation

Develop and verify a simple fixed-point algorithm.

Compute sine and cosine using a CORDIC rotation kernel in MATLAB®. CORDIC-based algorithms are critical to many embedded applications, including motor controls, navigation, signal

Implement fixed-point square root using a lookup table. Lookup tables generate efficient code for embedded devices.

Convert Cartesian to polar coordinates using a CORDIC vectoring kernel algorithm in MATLAB®. CORDIC-based algorithms are critical to many embedded applications, including motor

Normalize data for use in lookup tables.

Implement fixed-point log2 using a lookup table. Lookup tables generate efficient code for embedded devices.

Define unsigned and signed two's complement integer and fixed-point numbers.

Analyze a fixed-point state-space system to detect limit cycles.

Perform basic fixed-point arithmetic operations.

The basics of how to use the fixed-point numeric object fi.

Compute and compare the statistics of the signal quantization error when using various rounding methods.

Perform binary point scaling in FI.

Set fixed point math attributes in MATLAB® code.

This file runs three versions of a Radix-4 FFT written in MATLAB:

Model, prototype, tune, and deploy algorithms using Simulink® and Embedded Coder® with the STM32F4 Discovery board. The audio filter tuning example demonstrates this workflow.

This example was authored by the MathWorks community.

This demo shows how a fixed-point cordic algorithm to calculate a phase from polar coordinates (arctan) can be implemented in MATLAB.

This demo introduces user to the new and enhanced bitwise operators provided in Fixed Point toolbox in R2007b. These functions are supported by Embedded MATLAB block for both software and

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a location from the following list:

See all countries