Documentation

Functions and Objects Supported for C and C++ Code Generation — Category List

You can generate efficient C and C++ code for a subset of MATLAB® built-in functions and toolbox functions, classes, and System objects that you call from MATLAB code. These functions, classes, and System objects are listed by MATLAB category or toolbox category in the following tables.

For an alphabetical list of supported functions, classes, and System objects, see Functions and Objects Supported for C and C++ Code Generation — Alphabetical List.

Aerospace Toolbox

C and C++ code generation for the following Aerospace Toolbox quaternion functions requires the Aerospace Blockset™ software.

Function

Remarks and Limitations

quatconj

quatdivide

quatinv

quatmod

quatmultiply

quatnorm

quatnormalize

Arithmetic Operations in MATLAB

See Array vs. Matrix Operations for detailed descriptions of the following operator equivalent functions.

Function

Remarks and Limitations

ctranspose

idivide

  • For efficient generated code, MATLAB rules for divide by zero are supported only for the 'round' option.

isa

ldivide

minus

mldivide

mpower

If A is a 2-by-2 or larger matrix and B is Inf or -Inf, mpower(A,B) returns a matrix of NaNs.

mrdivide

mtimes

  • Multiplication of pure imaginary numbers by non-finite numbers might not match MATLAB. The code generation software does not specialize multiplication by pure imaginary numbers—it does not eliminate calculations with the zero real part. For example, (Inf + 1i)*1i = (Inf*0 – 1*1) + (Inf*1 + 1*0)i = NaN + Infi.

  • Variable-Sizing Restrictions for Code Generation of Toolbox Functions

plus

power

  • Generates an error during simulation. When both X and Y are real, but power(X,Y) is complex, returns NaN in the generated code. To get the complex result, make the input value X complex by passing in complex(X). For example, power(complex(X),Y).

  • Generates an error during simulation. When both X and Y are real, but X .^ Y is complex, returns NaN in generated code. To get the complex result, make the input value X complex by using complex(X). For example, complex(X).^Y.

rdivide

times

Multiplication of pure imaginary numbers by non-finite numbers might not match MATLAB. The code generation software does not specialize multiplication by pure imaginary numbers—it does not eliminate calculations with the zero real part. For example, (Inf + 1i)*1i = (Inf*0 – 1*1) + (Inf*1 + 1*0)i = NaN + Infi.

transpose

uminus

uplus

Audio System Toolbox

C and C++ code generation for the following functions and System objects requires the Audio System Toolbox™ software.

NameRemarks and Limitations
Audio I/O and Waveform Generation

audioDeviceReader

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

audioDeviceWriter

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

wavetableSynthesizer

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

audioOscillator

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

Audio Processing Algorithm Design

designVarSlopeFilter

Supports MATLAB Function Block: Yes

designParamEQ

Supports MATLAB Function Block: Yes

designShelvingEQ

Supports MATLAB Function Block: Yes

crossoverFilter

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

compressor

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

expander

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

noiseGate

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

limiter

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

multibandParametricEQ

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

reverberator

System Objects in MATLAB Code Generation

Supports MATLAB Function Block: Yes

Audio Plugins

audioPluginInterface

Supports MATLAB Function Block: Yes

audioPluginParameter

Supports MATLAB Function Block: Yes

audioPlugin

Supports MATLAB Function Block: Yes

audioPluginSource

Supports MATLAB Function Block: Yes

Bit-Wise Operations MATLAB

Function

Remarks and Limitations

flintmax

swapbytes

Inheritance of the class of the input to swapbytes in a MATLAB Function block is supported only when the class of the input is double. For non-double inputs, the input port data types must be specified, not inherited.

Casting in MATLAB

Function

Remarks and Limitations

cast

char

Does not support cell arrays.

class

double

int8, int16, int32, int64

logical

single

typecast

  • Value of string input argument type must be lowercase.

  • When you use typecast with inheritance of input port data types in MATLAB Function blocks, you can receive a size error. To avoid this error, specify the block input port data types explicitly.

  • Integer input or result classes must map directly to a C type on the target hardware.

  • The input must be a variable-length vector or a fixed-size vector. See

    Variable-Sizing Restrictions for Code Generation of Toolbox Functions

  • The output vector always has the same orientation as the input vector.

uint8, uint16, uint32, uint64

Communications System Toolbox

C and C++ code generation for the following functions and System objects requires the Communications System Toolbox™ software.

NameRemarks and Limitations
Input and Output

comm.BarkerCode

System Objects in MATLAB Code Generation

comm.GoldSequence

System Objects in MATLAB Code Generation

comm.HadamardCode

System Objects in MATLAB Code Generation

comm.KasamiSequence

System Objects in MATLAB Code Generation

comm.WalshCode

System Objects in MATLAB Code Generation

comm.PNSequence

System Objects in MATLAB Code Generation

lteZadoffChuSeq

Signal and Delay Management

bi2de

de2bi

Display and Visual Analysis

comm.ConstellationDiagram

System Objects in MATLAB Code Generation

dsp.ArrayPlot

System Objects in MATLAB Code Generation

dsp.SpectrumAnalyzer

System Objects in MATLAB Code Generation

dsp.TimeScope

System Objects in MATLAB Code Generation

Source Coding
comm.DifferentialDecoder

System Objects in MATLAB Code Generation

comm.DifferentialEncoder

System Objects in MATLAB Code Generation

Cyclic Redundancy Check Coding

comm.CRCDetector

System Objects in MATLAB Code Generation

comm.CRCGenerator

System Objects in MATLAB Code Generation

comm.HDLCRCDetector

System Objects in MATLAB Code Generation

comm.HDLCRCGenerator

System Objects in MATLAB Code Generation

BCH Codes

comm.BCHDecoder

System Objects in MATLAB Code Generation

comm.BCHEncoder

System Objects in MATLAB Code Generation

Reed-Solomon Codes

comm.RSDecoder

System Objects in MATLAB Code Generation

comm.RSEncoder

System Objects in MATLAB Code Generation

comm.HDLRSDecoder

System Objects in MATLAB Code Generation

comm.HDLRSEncoder

System Objects in MATLAB Code Generation

LDPC Codes

comm.LDPCDecoder

Using default properties, comm.LDPCDecoder does not support code generation. To generate code, specify the ParityCheckMatrix property as a non-sparse row-column index matrix.

comm.LDPCEncoder

System Objects in MATLAB Code Generation

Convolutional Coding

comm.APPDecoder

System Objects in MATLAB Code Generation

comm.ConvolutionalEncoder

System Objects in MATLAB Code Generation

comm.TurboDecoder

System Objects in MATLAB Code Generation

comm.TurboEncoder

System Objects in MATLAB Code Generation

comm.ViterbiDecoder

System Objects in MATLAB Code Generation

convenc

istrellis

poly2trellis

vitdec

Signal Operations

comm.Descrambler

System Objects in MATLAB Code Generation

comm.Scrambler

System Objects in MATLAB Code Generation

Interleaving

comm.AlgebraicDeinterleaver

System Objects in MATLAB Code Generation

comm.AlgebraicInterleaver

System Objects in MATLAB Code Generation

comm.BlockDeinterleaver

System Objects in MATLAB Code Generation

comm.BlockInterleaver

System Objects in MATLAB Code Generation

comm.ConvolutionalDeinterleaver

System Objects in MATLAB Code Generation

comm.ConvolutionalInterleaver

System Objects in MATLAB Code Generation

comm.HelicalDeinterleaver

System Objects in MATLAB Code Generation

comm.HelicalInterleaver

System Objects in MATLAB Code Generation

comm.MatrixDeinterleaver

System Objects in MATLAB Code Generation

comm.MatrixInterleaver

System Objects in MATLAB Code Generation

comm.MatrixHelicalScanDeinterleaver

System Objects in MATLAB Code Generation

comm.MatrixHelicalScanInterleaver

System Objects in MATLAB Code Generation

comm.MultiplexedDeinterleaver

System Objects in MATLAB Code Generation

comm.MultiplexedInterleaver

System Objects in MATLAB Code Generation

Frequency Modulation

comm.FSKDemodulator

System Objects in MATLAB Code Generation

comm.FSKModulator

System Objects in MATLAB Code Generation

Phase Modulation
comm.BPSKDemodulator

System Objects in MATLAB Code Generation

comm.BPSKModulator

System Objects in MATLAB Code Generation

comm.DBPSKDemodulator

System Objects in MATLAB Code Generation

comm.DBPSKModulator

System Objects in MATLAB Code Generation

comm.DPSKDemodulator

System Objects in MATLAB Code Generation

comm.DPSKModulator

System Objects in MATLAB Code Generation

comm.DQPSKDemodulator

System Objects in MATLAB Code Generation

comm.DQPSKModulator

System Objects in MATLAB Code Generation

comm.OQPSKDemodulator

System Objects in MATLAB Code Generation

comm.OQPSKModulator

System Objects in MATLAB Code Generation

comm.PSKDemodulator

System Objects in MATLAB Code Generation

comm.PSKModulator

System Objects in MATLAB Code Generation

comm.QPSKDemodulator

System Objects in MATLAB Code Generation

comm.QPSKModulator

System Objects in MATLAB Code Generation

dpskdemod

dpskmod

Amplitude Modulation
comm.GeneralQAMDemodulator

System Objects in MATLAB Code Generation

comm.GeneralQAMModulator

System Objects in MATLAB Code Generation

comm.PAMDemodulator

System Objects in MATLAB Code Generation

comm.PAMModulator

System Objects in MATLAB Code Generation

comm.RectangularQAMDemodulator

System Objects in MATLAB Code Generation

comm.RectangularQAMModulator

System Objects in MATLAB Code Generation

qammod

qamdemod

Continuous Phase Modulation
comm.CPFSKDemodulator

System Objects in MATLAB Code Generation

comm.CPFSKModulator

System Objects in MATLAB Code Generation

comm.CPMDemodulator

System Objects in MATLAB Code Generation

comm.CPMModulator

System Objects in MATLAB Code Generation

comm.GMSKDemodulator

System Objects in MATLAB Code Generation

comm.GMSKModulator

System Objects in MATLAB Code Generation

comm.MSKDemodulator

System Objects in MATLAB Code Generation

comm.MSKModulator

System Objects in MATLAB Code Generation

Trellis Coded Modulation
comm.GeneralQAMTCMDemodulator

System Objects in MATLAB Code Generation

comm.GeneralQAMTCMModulator

System Objects in MATLAB Code Generation

comm.PSKTCMDemodulator

System Objects in MATLAB Code Generation

comm.PSKTCMModulator

System Objects in MATLAB Code Generation

comm.RectangularQAMTCMDemodulator

System Objects in MATLAB Code Generation

comm.RectangularQAMTCMModulator

System Objects in MATLAB Code Generation

Orthogonal Frequency-Division Modulation
comm.OFDMDemodulator

System Objects in MATLAB Code Generation

comm.OFDMModulator

System Objects in MATLAB Code Generation

Analog Baseband Modulation 
comm.FMBroadcastDemodulator

System Objects in MATLAB Code Generation

comm.FMBroadcastModulator

System Objects in MATLAB Code Generation

comm.FMDemodulator

System Objects in MATLAB Code Generation

comm.FMModulator

System Objects in MATLAB Code Generation

Filtering
comm.IntegrateAndDumpFilter

System Objects in MATLAB Code Generation

comm.RaisedCosineReceiveFilter

System Objects in MATLAB Code Generation

comm.RaisedCosineTransmitFilter

System Objects in MATLAB Code Generation

Carrier Phase Synchronization
comm.CarrierSynchronizer

System Objects in MATLAB Code Generation

comm.CPMCarrierPhaseSynchronizer

System Objects in MATLAB Code Generation

comm.CoarseFrequencyCompensator

System Objects in MATLAB Code Generation

Timing Phase Synchronization
comm.SymbolSynchronizer

System Objects in MATLAB Code Generation

comm.GMSKTimingSynchronizer

System Objects in MATLAB Code Generation

comm.MSKTimingSynchronizer

System Objects in MATLAB Code Generation

Synchronization Utilities
comm.DiscreteTimeVCO

System Objects in MATLAB Code Generation

Equalization
comm.MLSEEqualizer

System Objects in MATLAB Code Generation

MIMO
comm.LTEMIMOChannel

System Objects in MATLAB Code Generation

comm.MIMOChannel

System Objects in MATLAB Code Generation

comm.OSTBCCombiner

System Objects in MATLAB Code Generation

comm.OSTBCEncoder

System Objects in MATLAB Code Generation

comm.SphereDecoder

System Objects in MATLAB Code Generation

Channel Modeling and RF Impairments
comm.AGC

System Objects in MATLAB Code Generation

comm.AWGNChannel

System Objects in MATLAB Code Generation

comm.BinarySymmetricChannel

System Objects in MATLAB Code Generation

comm.IQImbalanceCompensator

System Objects in MATLAB Code Generation

comm.LTEMIMOChannel

System Objects in MATLAB Code Generation

comm.MemorylessNonlinearity

System Objects in MATLAB Code Generation

comm.MIMOChannel

System Objects in MATLAB Code Generation

comm.PhaseFrequencyOffset

System Objects in MATLAB Code Generation

comm.PhaseNoise

System Objects in MATLAB Code Generation

comm.RayleighChannel

System Objects in MATLAB Code Generation

comm.RicianChannel

System Objects in MATLAB Code Generation

comm.ThermalNoise

System Objects in MATLAB Code Generation

comm.PSKCoarseFrequencyEstimator

System Objects in MATLAB Code Generation

comm.QAMCoarseFrequencyEstimator

System Objects in MATLAB Code Generation

iqcoef2imbal

iqimbal2coef

Measurements and Analysis
comm.ACPR

System Objects in MATLAB Code Generation

comm.CCDF

System Objects in MATLAB Code Generation

comm.ErrorRate

System Objects in MATLAB Code Generation

comm.EVM

System Objects in MATLAB Code Generation

comm.MER

System Objects in MATLAB Code Generation

Complex Numbers in MATLAB

Function

Remarks and Limitations

complex

conj

imag

isnumeric

isreal

isscalar

real

unwrap

  • Row vector input is only supported when the first two inputs are vectors and nonscalar

  • Performs arithmetic in the output class. Hence, results might not match MATLAB due to different rounding errors

Computer Vision System Toolbox

C and C++ code generation for the following functions and System objects requires the Computer Vision System Toolbox™ software.

NameRemarks and Limitations
Feature Detection, Extraction, and Matching
BRISKPointsSupports MATLAB Function block: No
To index locations with this object, use the syntax: points.Location(idx,:), for points object. See visionRecovertformCodeGeneration_kernel.m, which is used in the Introduction to Code Generation with Feature Matching and Registration example.
cornerPointsSupports MATLAB Function block: No
To index locations with this object, use the syntax: points.Location(idx,:), for points object. See visionRecovertformCodeGeneration_kernel.m, which is used in the Introduction to Code Generation with Feature Matching and Registration example.
detectBRISKFeaturesSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
detectFASTFeaturesSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
detectHarrisFeaturesCompile-time constant input: 'FilterSize'
Supports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
detectMinEigenFeaturesCompile-time constant input: 'FilterSize'
Supports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
detectMSERFeaturesSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries
Portable C Code Generation for Functions That Use OpenCV Library
For code generation, the function outputs regions.PixelList as an array. The region sizes are defined in regions.Lengths.
detectSURFFeaturesSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
extractFeaturesCompile-time constant input restrictions: 'Method'
Supports MATLAB Function block: Yes for Block method only.
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries for BRISK, FREAK, and SURF Methods.
Portable C Code Generation for Functions That Use OpenCV Library
extractHOGFeaturesSupports MATLAB Function block: No
extractLBPFeaturesGenerates platform-dependent library: No
Supports MATLAB Function block: Yes
matchFeaturesGenerates platform-dependent library: Yes for MATLAB host only when using the Exhaustive method.
Generates portable C code for non-host target only when using the Exhaustive method.
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries when not using the Exhaustive method.
Portable C Code Generation for Functions That Use OpenCV Library
Compile-time constant input: 'Method‘ and 'Metric'.
Supports MATLAB Function block: No
MSERRegionsSupports MATLAB Function block: Yes
For code generation, you must specify both the pixellist cell array and the length of each array, as the second input. The object outputs, regions.PixelList as an array. The region sizes are defined in regions.Lengths.
Generated code for this function uses a precompiled platform-specific shared library.
SURFPointsSupports MATLAB Function block: No
To index locations with this object, use the syntax: points.Location(idx,:), for points object. See visionRecovertformCodeGeneration_kernel.m, which is used in the Introduction to Code Generation with Feature Matching and Registration example.
Image Registration and Geometric Transformations
estimateGeometricTransformSupports MATLAB Function block: No
vision.GeometricShearerSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
Object Detection and Recognition
ocrCompile-time constant input: 'TextLayout', 'Language', and 'CharacterSet'.
Supports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
ocrTextSupports MATLAB Function block: No
vision.PeopleDetectorSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
System Objects in MATLAB Code Generation
vision.CascadeObjectDetectorSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries
Portable C Code Generation for Functions That Use OpenCV Library
System Objects in MATLAB Code Generation
Tracking and Motion Estimation
assignDetectionsToTracksSupports MATLAB Function block: Yes
opticalFlowFarnebackSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
opticalFlowHSSupports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
opticalFlowLKDoGSupports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
opticalFlowLKSupports MATLAB Function block: No
Generated code for this function uses a precompiled platform-specific shared library.
vision.ForegroundDetectorSupports MATLAB Function block: No
Generates platform-dependent library: Yes for MATLAB host.
Generates portable C code for non-host target.
Generated code for this function uses a precompiled platform-specific shared library.
System Objects in MATLAB Code Generation
vision.HistogramBasedTrackerSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.KalmanFilterSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.PointTrackerSupports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
System Objects in MATLAB Code Generation
vision.TemplateMatcherSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
Camera Calibration and Stereo Vision
bboxOverlapRatioSupports MATLAB Function block: No
bbox2points

Supports MATLAB® Function block: Yes

disparityCompile-time constant input restriction: 'Method'.
Supports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to OpenCV (Version 2.4.9) libraries.
Portable C Code Generation for Functions That Use OpenCV Library
cameraMatrixSupports MATLAB Function block: No
cameraPoseSupports MATLAB Function block: No
cameraParametersSupports MATLAB Function block: No
Use the toStruct method to pass a cameraParameters object into generated code. See the Code Generation for Depth Estimation From Stereo Video example.
detectCheckerboardPointsSupports MATLAB Function block: No
Code generation will not support specifying images as file names or cell arrays of file names. It supports only checkerboard detection in a single image or stereo pair of images. For example, these syntaxes are supported:
  • detectCheckerboardPoints(I1)

  • detectCheckerobarPoints(I1,I2)

I1 and I2 are single grayscale or RGB images.
generateCheckerboardPointsSupports MATLAB Function block: No
epipolarlineSupports MATLAB Function block: Yes
estimateFundamentalMatrixCompile-time constant input restriction: 'Method', 'OutputClass', 'DistanceType', and 'ReportRuntimeError'.
Supports MATLAB Function block: Yes
estimateUncalibratedRectificationSupports MATLAB Function block: Yes
extrinsicsSupports MATLAB Function block: No
isEpipoleInImageSupports MATLAB Function block: Yes
lineToBorderPointsSupports MATLAB Function block: Yes
reconstructSceneSupports MATLAB Function block: No
rectifyStereoImagesCompile-time constant input restriction: 'interp' and 'OutputView'
Supports MATLAB Function block: No
rotationMatrixToVectorSupports MATLAB Function block: Yes
rotationVectorToMatrixSupports MATLAB Function block: Yes
selectStrongestBboxSupports MATLAB Function block: No
stereoAnaglyphSupports MATLAB Function block: Yes
stereoParametersSupports MATLAB Function block: No
Use the toStruct method to pass a stereoParameters object into generated code. See the Code Generation for Depth Estimation From Stereo Video example.
triangulateSupports MATLAB Function block: No
undistortImageCompile-time constant input restriction: 'interp' and 'OutputView'
Supports MATLAB Function block: No
Statistics
vision.AutocorrelatorSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.BlobAnalysisSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.CrosscorrelatorSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.LocalMaximaFinderSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MaximumSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MeanSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MedianSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MinimumSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.StandardDeviationSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.VarianceSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
Filters, Transforms, and Enhancements
integralImageSupports MATLAB Function block: Yes
vision.ConvolverSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.DCTSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.DeinterlacerSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.FFTSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.HoughLinesSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.IDCTSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.IFFTSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MedianFilterSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.PyramidSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
Video Loading, Saving, and Streaming
vision.DeployableVideoPlayerSupports MATLAB Function block: Yes
Generated code for this function uses a precompiled platform-specific shared library.
System Objects in MATLAB Code Generation
vision.VideoFileReaderSupports MATLAB Function block: Yes
Generated code for this function uses a precompiled platform-specific shared library.
System Objects in MATLAB Code Generation

Does not generate code for reading compressed images on the Mac.

vision.VideoFileWriterSupports MATLAB Function block: Yes
Generated code for this function uses a precompiled platform-specific shared library.
System Objects in MATLAB Code Generation
Color Space Formatting and Conversions
vision.ChromaResamplerSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.DemosaicInterpolatorSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.GammaCorrectorSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
Graphics
insertMarkerCompile-time constant input: 'Shape' and 'Color'
Supports MATLAB Function block: Yes
insertShapeCompile-time constant input: 'Color' and 'SmoothEdges'
Supports MATLAB Function block: Yes
insertObjectAnnotationSupports MATLAB Function block: Yes
Limitation: Input image must be bounded, see Specify Variable-Size Data Without Dynamic Memory Allocation
System Objects in MATLAB Code Generation
insertTextCompile-time constant input: Font, FontSize
Supports non-ASCII characters: No
Supports MATLAB Function block: Yes
vision.AlphaBlenderSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.MarkerInserterSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation
vision.ShapeInserterSupports MATLAB Function block: Yes
System Objects in MATLAB Code Generation

Control Flow in MATLAB

Function

Remarks and Limitations

break

continue

end

for

if, elseif, else

parfor

Treated as a for-loop when used with fiaccel.

return

switch, case, otherwise

  • If all case expressions are scalar integer values, generates a C switch statement. At run time, if the switch value is not an integer, generates an error.

  • When the case expressions contain noninteger or nonscalar values, the code generation software generates C if statements in place of a C switch statement.

while

Data and File Management in MATLAB

Function

Remarks and Limitations

computer

  • Information about the computer on which the code generation software is running.

  • Use only when the code generation target is S-function (Simulation) or MEX-function.

fclose

feof

fopen

  • Does not support:

    • machineformat, encoding, or fileID inputs

    • message output

    • fopen('all')

  • If you disable extrinsic calls, you cannot return fileIDs created with fopen to MATLAB or extrinsic functions. You can use such fileIDs only internally.

  • When generating C/C++ executables, static libraries, or dynamic libraries, you can open up to 20 files.

  • The generated code does not report errors from invalid file identifiers. Write your own file open error handling in your MATLAB code. Test whether fopen returns -1, which indicates that the file open failed. For example:

    ...
    fid = fopen(filename, 'r');
    if fid == -1
    		% fopen failed
    
    else
    % fopen successful, okay to call fread
    A = fread(fid);
    ...

  • The behavior of the generated code for fread is compiler-dependent if you:

    1. Open a file using fopen with a permission of a+.

    2. Read the file using fread before calling an I/O function, such as fseek or frewind, that sets the file position indicator.

fprintf

  • Does not support:

    • b and t subtypes on %u, %o %x, and %X formats.

    • $ flag for reusing input arguments.

    • printing arrays.

  • There is no automatic casting. Input arguments must match their format types for predictable results.

  • Escaped characters are limited to the decimal range of 0–127.

  • A call to fprintf with fileID equal to 1 or 2 becomes printf in the generated C/C++ code in the following cases:

    • The fprintf call is inside a parfor loop.

    • Extrinsic calls are disabled.

  • When the MATLAB behavior differs from the C compiler behavior, fprintf matches the C compiler behavior in the following cases:

    • The format specifier has a corresponding C format specifier, for example, %e or %E.

    • The fprintf call is inside a parfor loop.

    • Extrinsic calls are disabled.

  • When you call fprintf with the format specifier %s, do not put a null character in the middle of the input string. Use fprintf(fid, '%c', char(0)) to write a null character.

  • When you call fprintf with an integer format specifier, the type of the integer argument must be a type that the target hardware can represent as a native C type. For example, if you call fprintf('%d', int64(n)), the target hardware must have a native C type that supports a 64-bit integer.

fread

  • precision must be a constant.

  • The source and output that precision specifies cannot have values long, ulong, unsigned long, bitN, or ubitN.

  • You cannot use the machineformat input.

  • If the source or output that precision specifies is a C type, for example, int, the target and production sizes for that type must:

    • Match.

    • Map directly to a MATLAB type.

  • The source type that precision specifies must map directly to a C type on the target hardware.

  • If the fread call reads the entire file, all of the data must fit in the largest array available for code generation.

  • If sizeA is not constant or contains a nonfinite element, then dynamic memory allocation is required.

  • Treats a char value for source or output as a signed 8-bit integer. Use values between 0 and 127 only.

  • The generated code does not report file read errors. Write your own file read error handling in your MATLAB code. Test that the number of bytes read matches the number of bytes that you requested. For example:

    ...
    N = 100;
    [vals, numRead] = fread(fid, N, '*double');
    if numRead ~= N
        % fewer elements read than expected
    end
    ...

frewind

load

  • Use only when generating MEX or code for Simulink® simulation. To load compile-time constants, use coder.load.

  • Does not support use of the function without assignment to a structure or array. For example, use S = load(filename), not load(filename).

  • The output S must be the name of a structure or array without any subscripting. For example, S(i) = load('myFile.mat') is not allowed.

  • Arguments to load must be compile-time constant strings.

  • Does not support loading objects.

  • If the MAT-file contains unsupported constructs, use load(filename,variables) to load only the supported constructs.

  • You cannot use save in a function intended for code generation. The code generation software does not support the save function. Furthermore, you cannot use coder.extrinsic with save. Prior to generating code, you can use save to save the workspace data to a MAT-file.

    You must use coder.varsize to explicitly declare variable-size data loaded using the load function.

Data Types in MATLAB

Function

Remarks and Limitations

cell

deal

fieldnames

Does not support objects. The input must be a structure.

iscell

isfield

Does not support cell arrays for the second argument.

isobject

isstruct

narginchk

nargoutchk

str2func

  • String must be constant/known at compile time

struct

  • You cannot create a structure that contains a cell array. For example, you cannot generate code for:

    s = struct('a',{{1 2}})

  • If the value argument is a cell array, all elements must have the same type.

struct2cell

  • For a variable-size structure array, the resulting cell array must be homogeneous. If s is a variable-size structure array, the fields must have the same type.

  • If struct2cell cannot convert s to a homogeneous cell array, the output cell array is heterogeneous. A heterogeneous output cell array can have a maximum of 1024 elements.

structfun

  • Does not support the ErrorHandler option.

  • The number of outputs must be less than or equal to three.

Desktop Environment in MATLAB

Function

Remarks and Limitations

ismac

  • Returns true or false based on the MATLAB version used for code generation.

  • Use only when the code generation target is S-function (Simulation) or MEX-function.

ispc

  • Returns true or false based on the MATLAB version you use for code generation.

  • Use only when the code generation target is S-function (Simulation) or MEX-function.

isunix

  • Returns true or false based on the MATLAB version used for code generation.

  • Use only when the code generation target is S-function (Simulation) or MEX-function.

Discrete Math in MATLAB

Function

Remarks and Limitations

factor

  • The maximum double precision input is 2^33.

  • The maximum single precision input is 2^25.

  • The input n cannot have type int64 or uint64.

gcd

isprime

  • The maximum double precision input is 2^33.

  • The maximum single precision input is 2^25.

  • The input X cannot have type int64 or uint64.

lcm

nchoosek

  • When the first input, x, is a scalar, nchoosek returns a binomial coefficient. In this case, x must be a nonnegative integer. It cannot have type int64 or uint64.

  • When the first input, x, is a vector, nchoosek treats it as a set. In this case, x can have type int64 or uint64.

  • The second input, k, cannot have type int64 or uint64.

  • Variable-Sizing Restrictions for Code Generation of Toolbox Functions

primes

  • The maximum double precision input is 2^32.

  • The maximum single precision input is 2^24.

  • The input n cannot have type int64 or uint64.

DSP System Toolbox

C code generation for the following functions and System objects requires the DSP System Toolbox™ license. Many DSP System Toolbox functions require constant inputs for code generation. To specify a constant input for fiaccel, use coder.Constant. For more information, see Specify Constant Inputs at the Command Line.

NameRemarks and Limitations
Estimation

dsp.BurgAREstimator

System Objects in MATLAB Code Generation

dsp.BurgSpectrumEstimator

System Objects in MATLAB Code Generation

dsp.CepstralToLPC

System Objects in MATLAB Code Generation

dsp.CrossSpectrumEstimator

System Objects in MATLAB Code Generation

dsp.LevinsonSolver

System Objects in MATLAB Code Generation

dsp.LPCToAutocorrelation

System Objects in MATLAB Code Generation

dsp.LPCToCepstral

System Objects in MATLAB Code Generation

dsp.LPCToLSF

System Objects in MATLAB Code Generation

dsp.LPCToLSP

System Objects in MATLAB Code Generation

dsp.LPCToRC

System Objects in MATLAB Code Generation

dsp.LSFToLPC

System Objects in MATLAB Code Generation

dsp.LSPToLPC

System Objects in MATLAB Code Generation

dsp.RCToAutocorrelation

System Objects in MATLAB Code Generation

dsp.RCToLPC

System Objects in MATLAB Code Generation

dsp.SpectrumEstimator

System Objects in MATLAB Code Generation

dsp.TransferFunctionEstimator

System Objects in MATLAB Code Generation

Filters

ca2tf

All inputs must be constant. Expressions or variables are allowed if their values do not change.

cl2tf

All inputs must be constant. Expressions or variables are allowed if their values do not change.

dsp.AdaptiveLatticeFilter

System Objects in MATLAB Code Generation

dsp.AffineProjectionFilter

System Objects in MATLAB Code Generation

dsp.AllpassFilter

System Objects in MATLAB Code Generation

The System object™ supports code generation only when the Structure property is set to Minimum multiplier or Lattice.

dsp.AllpoleFilter

dsp.BiquadFilter

System Objects in MATLAB Code Generation

dsp.CICCompensationDecimator

System Objects in MATLAB Code Generation

dsp.CICCompensationInterpolator

System Objects in MATLAB Code Generation

dsp.CICDecimator

System Objects in MATLAB Code Generation

dsp.CICInterpolator

System Objects in MATLAB Code Generation

dsp.Differentiator

System Objects in MATLAB Code Generation

dsp.FarrowRateConverter

System Objects in MATLAB Code Generation

dsp.FastTransversalFilter

System Objects in MATLAB Code Generation

dsp.FilterCascade

  • You cannot generate code directly from dsp.FilterCascade. You can use the generateFilteringCode method to generate a MATLAB function. You can generate C/C++ code from this MATLAB function.

  • System Objects in MATLAB Code Generation

dsp.FilteredXLMSFilter

System Objects in MATLAB Code Generation

dsp.FIRDecimator

System Objects in MATLAB Code Generation

dsp.FIRFilter

dsp.FIRHalfbandDecimator

System Objects in MATLAB Code Generation

dsp.FIRHalfbandInterpolator

System Objects in MATLAB Code Generation

dsp.FIRInterpolator

System Objects in MATLAB Code Generation

dsp.FIRRateConverter

System Objects in MATLAB Code Generation

dsp.FrequencyDomainAdaptiveFilter

System Objects in MATLAB Code Generation

dsp.HighpassFilter

System Objects in MATLAB Code Generation

dsp.IIRFilter

dsp.IIRHalfbandDecimator

System Objects in MATLAB Code Generation

dsp.IIRHalfbandInterpolator

System Objects in MATLAB Code Generation

dsp.KalmanFilter

System Objects in MATLAB Code Generation

dsp.LMSFilter

System Objects in MATLAB Code Generation

dsp.LowpassFilter

System Objects in MATLAB Code Generation

dsp.RLSFilter

System Objects in MATLAB Code Generation

dsp.SampleRateConverter

System Objects in MATLAB Code Generation

dsp.SubbandAnalysisFilter

System Objects in MATLAB Code Generation

dsp.SubbandSynthesisFilter

System Objects in MATLAB Code Generation

dsp.VariableBandwidthFIRFilter

System Objects in MATLAB Code Generation

dsp.VariableBandwidthIIRFilter

System Objects in MATLAB Code Generation

firceqrip

All inputs must be constant. Expressions or variables are allowed if their values do not change.

fireqint

All inputs must be constant. Expressions or variables are allowed if their values do not change.

firgr

  • All inputs must be constant. Expressions or variables are allowed if their values do not change.

  • Does not support syntaxes that have cell array input.

firhalfband

All inputs must be constant. Expressions or variables are allowed if their values do not change.

firlpnorm

  • All inputs must be constant. Expressions or variables are allowed if their values do not change.

  • Does not support syntaxes that have cell array input.

firminphase

All inputs must be constant. Expressions or variables are allowed if their values do not change.

firnyquist

All inputs must be constant. Expressions or variables are allowed if their values do not change.

firpr2chfb

All inputs must be constant. Expressions or variables are allowed if their values do not change.

ifir

All inputs must be constant. Expressions or variables are allowed if their values do not change.

iircomb

All inputs must be constant. Expressions or variables are allowed if their values do not change.

iirgrpdelay

  • All inputs must be constant. Expressions or variables are allowed if their values do not change.

  • Does not support syntaxes that have cell array input.

iirlpnorm

  • All inputs must be constant. Expressions or variables are allowed if their values do not change.

  • Does not support syntaxes that have cell array input.

iirlpnormc

  • All inputs must be constant. Expressions or variables are allowed if their values do not change.

  • Does not support syntaxes that have cell array input.

iirnotch

All inputs must be constant. Expressions or variables are allowed if their values do not change.

iirpeak

All inputs must be constant. Expressions or variables are allowed if their values do not change.

tf2ca

All inputs must be constant. Expressions or variables are allowed if their values do not change.

tf2cl

All inputs must be constant. Expressions or variables are allowed if their values do not change.

Filter Design 

designMultirateFIR

The inputs to the function must be constants

Math Operations 

dsp.ArrayVectorAdder

System Objects in MATLAB Code Generation

dsp.ArrayVectorDivider

System Objects in MATLAB Code Generation

dsp.ArrayVectorMultiplier

System Objects in MATLAB Code Generation

dsp.ArrayVectorSubtractor

System Objects in MATLAB Code Generation

dsp.CumulativeProduct

System Objects in MATLAB Code Generation

dsp.CumulativeSum

System Objects in MATLAB Code Generation

dsp.LDLFactor

System Objects in MATLAB Code Generation

dsp.LevinsonSolver

System Objects in MATLAB Code Generation

dsp.LowerTriangularSolver

System Objects in MATLAB Code Generation

dsp.LUFactor

System Objects in MATLAB Code Generation

dsp.Normalizer

System Objects in MATLAB Code Generation

dsp.UpperTriangularSolver

System Objects in MATLAB Code Generation

Quantizers

dsp.ScalarQuantizerDecoder

System Objects in MATLAB Code Generation

dsp.ScalarQuantizerEncoder

System Objects in MATLAB Code Generation

dsp.VectorQuantizerDecoder

System Objects in MATLAB Code Generation

dsp.VectorQuantizerEncoder

System Objects in MATLAB Code Generation

Scopes

dsp.SpectrumAnalyzer

This System object does not generate code. It is automatically declared as an extrinsic variable using the coder.extrinsic function.

dsp.TimeScope

This System object does not generate code. It is automatically declared as an extrinsic variable using the coder.extrinsic function.

Signal Management

dsp.Counter

System Objects in MATLAB Code Generation

dsp.DelayLine

System Objects in MATLAB Code Generation

Signal Operations

dsp.Convolver

System Objects in MATLAB Code Generation

dsp.DCBlocker

System Objects in MATLAB Code Generation

dsp.Delay

System Objects in MATLAB Code Generation

dsp.DigitalDownConverter

System Objects in MATLAB Code Generation

dsp.DigitalUpConverter

System Objects in MATLAB Code Generation

dsp.Interpolator

System Objects in MATLAB Code Generation

dsp.NCO

System Objects in MATLAB Code Generation

dsp.PeakFinder

System Objects in MATLAB Code Generation

dsp.PhaseExtractor

System Objects in MATLAB Code Generation

dsp.PhaseUnwrapper

System Objects in MATLAB Code Generation

dsp.VariableFractionalDelay

System Objects in MATLAB Code Generation

dsp.VariableIntegerDelay

System Objects in MATLAB Code Generation

dsp.Window

dsp.ZeroCrossingDetector

System Objects in MATLAB Code Generation

Sinks

audioDeviceWriter

System Objects in MATLAB Code Generation

dsp.AudioFileWriter

System Objects in MATLAB Code Generation

dsp.UDPSender

System Objects in MATLAB Code Generation

Sources

dsp.AudioFileReader

System Objects in MATLAB Code Generation

dsp.SignalSource

System Objects in MATLAB Code Generation

dsp.SineWave

dsp.UDPReceiver

System Objects in MATLAB Code Generation

Statistics

dsp.Autocorrelator

System Objects in MATLAB Code Generation

dsp.Crosscorrelator

System Objects in MATLAB Code Generation

dsp.Histogram

dsp.Maximum

System Objects in MATLAB Code Generation

dsp.Mean

System Objects in MATLAB Code Generation

dsp.Median

System Objects in MATLAB Code Generation

dsp.Minimum

System Objects in MATLAB Code Generation

dsp.PeakToPeak

System Objects in MATLAB Code Generation

dsp.PeakToRMS

System Objects in MATLAB Code Generation

dsp.RMS

System Objects in MATLAB Code Generation

dsp.StandardDeviation

System Objects in MATLAB Code Generation

dsp.StateLevels

System Objects in MATLAB Code Generation

dsp.Variance

System Objects in MATLAB Code Generation

Transforms

dsp.AnalyticSignal

System Objects in MATLAB Code Generation

dsp.DCT

System Objects in MATLAB Code Generation

dsp.FFT

System Objects in MATLAB Code Generation

dsp.IDCT

System Objects in MATLAB Code Generation

dsp.IFFT

System Objects in MATLAB Code Generation

Error Handling in MATLAB

Function

Remarks and Limitations

assert

  • Generates specified error messages at compile time only if all input arguments are constants or depend on constants. Otherwise, generates specified error messages at run time.

  • For standalone code generation, excluded from the generated code.

  • See Rules for Using assert Function.

error

For standalone code generation, excluded from the generated code.

Exponents in MATLAB

Function

Remarks and Limitations

exp

expm

expm1

factorial

log

  • Generates an error during simulation and returns NaN in generated code when the input value x is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(x).

log2

log10

log1p

nextpow2

nthroot

reallog

realpow

realsqrt

sqrt

  • Generates an error during simulation and returns NaN in generated code when the input value x is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(x).

Filtering and Convolution in MATLAB

Function

Remarks and Limitations

conv

conv2

convn

deconv

detrend

  • If supplied and not empty, the input argument bp must satisfy the following requirements:

filter

filter2

Fixed-Point Designer

In addition to function-specific limitations listed in the table, the following general limitations apply to the use of Fixed-Point Designer™ functions in generated code, with fiaccel:

  • fipref and quantizer objects are not supported.

  • Word lengths greater than 128 bits are not supported.

  • You cannot change the fimath or numerictype of a given fi variable after that variable has been created.

  • The boolean value of the DataTypeMode and DataType properties are not supported.

  • For all SumMode property settings other than FullPrecision, the CastBeforeSum property must be set to true.

  • You can use parallel for (parfor) loops in code compiled with fiaccel, but those loops are treated like regular for loops.

  • When you compile code containing fi objects with nontrivial slope and bias scaling, you may see different results in generated code than you achieve by running the same code in MATLAB.

FunctionRemarks/Limitations

abs

N/A

accumneg

N/A

accumpos

N/A

add

  • Code generation in MATLAB does not support the syntax F.add(a,b). You must use the syntax add(F,a,b).

all

N/A

any

N/A

atan2

N/A

bitand

Not supported for slope-bias scaled fi objects.

bitandreduce

N/A

bitcmp

N/A

bitconcat

N/A

bitget

N/A

bitor

Not supported for slope-bias scaled fi objects.

bitorreduce

N/A

bitreplicate

N/A

bitrol

N/A

bitror

N/A

bitset

N/A

bitshift

N/A

bitsliceget

N/A

bitsll

Generated code may not handle out of range shifting.

bitsra

Generated code may not handle out of range shifting.

bitsrl

Generated code may not handle out of range shifting.

bitxor

Not supported for slope-bias scaled fi objects.

bitxorreduce

N/A

ceil

N/A

complex

N/A

conj

N/A

conv

  • Variable-sized inputs are only supported when the SumMode property of the governing fimath is set to Specify precision or Keep LSB.

  • For variable-sized signals, you may see different results between generated code and MATLAB.

    • In the generated code, the output for variable-sized signals is computed using the SumMode property of the governing fimath.

    • In MATLAB, the output for variable-sized signals is computed using the SumMode property of the governing fimath when both inputs are nonscalar. However, if either input is a scalar, MATLAB computes the output using the ProductMode of the governing fimath.

convergent

N/A

cordicabs

Variable-size signals are not supported.

cordicangle

Variable-size signals are not supported.

cordicatan2

Variable-size signals are not supported.

cordiccart2pol

Variable-size signals are not supported.

cordiccexp

Variable-size signals are not supported.

cordiccos

Variable-size signals are not supported.

cordicpol2cart

Variable-size signals are not supported.

cordicrotate

Variable-size signals are not supported.

cordicsin

Variable-size signals are not supported.

cordicsincos

Variable-size signals are not supported.

cordicsqrt

Variable-size signals are not supported.

cos

N/A

ctranspose

N/A

diag

If supplied, the index, k, must be a real and scalar integer value that is not a fi object.

divide

  • Any non-fi input must be constant; that is, its value must be known at compile time so that it can be cast to a fi object.

  • Complex and imaginary divisors are not supported.

  • Code generation in MATLAB does not support the syntax T.divide(a,b).

double

For the automated workflow, do not use explicit double or single casts in your MATLAB algorithm to insulate functions that do not support fixed-point data types. The automated conversion tool does not support these casts. Instead of using casts, supply a replacement function. For more information, see Function Replacements.

end

N/A

eps

  • Supported for scalar fixed-point signals only.

  • Supported for scalar, vector, and matrix, fi single and fi double signals.

eq

Not supported for fixed-point signals with different biases.

fi

  • The default constructor syntax without any input arguments is not supported.

  • If the numerictype is not fully specified, the input to fi must be a constant, a fi, a single, or a built-in integer value. If the input is a built-in double value, it must be a constant. This limitation allows fi to autoscale its fraction length based on the known data type of the input.

  • All properties related to data type must be constant for code generation.

  • numerictype object information must be available for nonfixed-point Simulink inputs.

filter

  • Variable-sized inputs are only supported when the SumMode property of the governing fimath is set to Specify precision or Keep LSB.

fimath

  • Fixed-point signals coming in to a MATLAB Function block from Simulink are assigned a fimath object. You define this object in the MATLAB Function block dialog in the Model Explorer.

  • Use to create fimath objects in the generated code.

  • If the ProductMode property of the fimath object is set to anything other than FullPrecision, the ProductWordLength and ProductFractionLength properties must be constant.

  • If the SumMode property of the fimath object is set to anything other than FullPrecision, the SumWordLength and SumFractionLength properties must be constant.

fix

N/A

fixed.Quantizer

N/A

flip

The dimensions argument must be a built-in type; it cannot be a fi object.

fliplr

N/A

flipud

N/A

floor

N/A

for

N/A

ge

Not supported for fixed-point signals with different biases.

get

The syntax structure = get(o) is not supported.

getlsb

N/A

getmsb

N/A

gt

Not supported for fixed-point signals with different biases.

horzcat

N/A

imag

N/A

int8int16int32,  int64

N/A

ipermute

N/A

iscolumn

N/A

isempty

N/A

isequal

N/A

isfi

Avoid using the isfi function in code that you intend to convert using the automated workflow. The value returned by isfi in the fixed-point code might differ from the value returned in the original MATLAB algorithm. The behavior of the fixed-point code might differ from the behavior of the original algorithm.

isfimath

N/A

isfimathlocal

N/A

isfinite

N/A

isinf

N/A

isnan

N/A

isnumeric

N/A

isnumerictype

N/A

isreal

N/A

isrow

N/A

isscalar

N/A

issigned

N/A

isvector

N/A

le

Not supported for fixed-point signals with different biases.

length

N/A

logical

N/A

lowerbound

N/A

lsb

  • Supported for scalar fixed-point signals only.

  • Supported for scalar, vector, and matrix, fi single and double signals.

lt

Not supported for fixed-point signals with different biases.

max

N/A

mean

N/A

median

N/A

min

N/A

minus

Any non-fi input must be constant; that is, its value must be known at compile time so that it can be cast to a fi object.

mpower

  • When the exponent k is a variable and the input is a scalar, the ProductMode property of the governing fimath must be SpecifyPrecision.

  • When the exponent k is a variable and the input is not scalar, the SumMode property of the governing fimath must be SpecifyPrecision.

  • Variable-sized inputs are only supported when the SumMode property of the governing fimath is set to SpecifyPrecision or Keep LSB.

  • For variable-sized signals, you may see different results between the generated code and MATLAB.

    • In the generated code, the output for variable-sized signals is computed using the SumMode property of the governing fimath.

    • In MATLAB, the output for variable-sized signals is computed using the SumMode property of the governing fimath when the first input, a, is nonscalar. However, when a is a scalar, MATLAB computes the output using the ProductMode of the governing fimath.

mpy

  • Code generation in MATLAB does not support the syntax F.mpy(a,b). You must use the syntax mpy(F,a,b).

  • When you provide complex inputs to the mpy function inside of a MATLAB Function block, you must declare the input as complex before running the simulation. To do so, go to the Ports and data manager and set the Complexity parameter for all known complex inputs to On.

mrdivide

N/A

mtimes

  • Any non-fi input must be constant; that is, its value must be known at compile time so that it can be cast to a fi object.

  • Variable-sized inputs are only supported when the SumMode property of the governing fimath is set to SpecifyPrecision or KeepLSB.

  • For variable-sized signals, you may see different results between the generated code and MATLAB.

    • In the generated code, the output for variable-sized signals is computed using the SumMode property of the governing fimath.

    • In MATLAB, the output for variable-sized signals is computed using the SumMode property of the governing fimath when both inputs are nonscalar. However, if either input is a scalar, MATLAB computes the output using the ProductMode of the governing fimath.

ndims

N/A

ne

Not supported for fixed-point signals with different biases.

nearest

N/A

numberofelements

numberofelements will be removed in a future release. Use numel instead.

numel

N/A

numerictype

  • Fixed-point signals coming in to a MATLAB Function block from Simulink are assigned a numerictype object that is populated with the signal's data type and scaling information.

  • Returns the data type when the input is a nonfixed-point signal.

  • Use to create numerictype objects in generated code.

  • All numerictype object properties related to the data type must be constant.

permute

The dimensions argument must be a built-in type; it cannot be a fi object.

plus

Any non-fi inputs must be constant; that is, its value must be known at compile time so that it can be cast to a fi object.

pow2

N/A

power

When the exponent k is a variable, the ProductMode property of the governing fimath must be SpecifyPrecision.

qr

N/A

quantize

N/A

range

N/A

rdivide

N/A

real

N/A

realmax

N/A

realmin

N/A

reinterpretcast

N/A

removefimath

N/A

repmat

The dimensions argument must be a built-in type; it cannot be a fi object.

rescale

N/A

reshape

N/A

rot90

In the syntax rot90(A,k), the argument k must be a built-in type; it cannot be a fi object.

round

N/A

setfimath

N/A

sfi

  • All properties related to data type must be constant for code generation.

shiftdim

The dimensions argument must be a built-in type; it cannot be a fi object.

sign

N/A

sin

N/A

single

For the automated workflow, do not use explicit double or single casts in your MATLAB algorithm to insulate functions that do not support fixed-point data types. The automated conversion tool does not support these casts. Instead of using casts, supply a replacement function. For more information, see Function Replacements.

size

N/A

sort

The dimensions argument must be a built-in type; it cannot be a fi object.

squeeze

N/A

sqrt

  • Complex and [Slope Bias] inputs error out.

  • Negative inputs yield a 0 result.

storedInteger

N/A

storedIntegerToDouble

N/A

sub

  • Code generation in MATLAB does not support the syntax F.sub(a,b). You must use the syntax sub(F,a,b).

subsasgn

N/A

subsref

N/A

sum

Variable-sized inputs are only supported when the SumMode property of the governing fimath is set to Specify precision or Keep LSB.

times

  • Any non-fi input must be constant; that is, its value must be known at compile time so that it can be cast to a fi object.

  • When you provide complex inputs to the times function inside of a MATLAB Function block, you must declare the input as complex before running the simulation. To do so, go to the Ports and data manager and set the Complexity parameter for all known complex inputs to On.

transpose

N/A

tril

If supplied, the index, k, must be a real and scalar integer value that is not a fi object.

triu

If supplied, the index, k, must be a real and scalar integer value that is not a fi object.

ufi

  • All properties related to data type must be constant for code generation.

uint8uint16uint32,  uint64

N/A

uminus

N/A

uplus

N/A

upperbound

N/A

vertcat

N/A

HDL Coder

Function

Remarks and Limitations

hdl.RAM

This System object is available with MATLAB.

Histograms in MATLAB

Function

Remarks and Limitations

hist

  • Histogram bar plotting not supported. Call with at least one output argument.

  • If supplied, the second argument x must be a scalar constant.

  • Inputs must be real.

For the syntax [nout, xout] = hist(y,x):

  • When y is a fixed-size vector or variable-length vector:

    • nout is always a row vector.

    • If x is a vector, xout is a vector with the same orientation as x.

    • If x is a scalar (fixed-size), xout is a row vector.

  • nout and xout are column vectors when the following conditions are true:

    • y is a matrix

    • size(y,1) and size(y,2) do not have fixed length 1

    • One of size(y,1) and size(y,2) has length 1 at run time

  • A variable-sizex is interpreted as a vector input even if it is a scalar at run time.

  • If at least one of the inputs is empty, vector orientations in the output can differ from MATLAB.

histc

Image Acquisition Toolbox

If you install Image Acquisition Toolbox™ software, you can generate C and C++ code for the VideoDevice System object. See imaq.VideoDevice and Code Generation with VideoDevice System Object.

Image Processing in MATLAB

FunctionRemarks and Limitations

im2double

rgb2gray

Image Processing Toolbox

The following table lists the Image Processing Toolbox™ functions that have been enabled for code generation. You must have the MATLAB Coder™ software installed to generate C code from MATLAB for these functions.

Image Processing Toolbox provides three types of code generation support:

  • Functions that generate C code.

  • Functions that generate C code that depends on a platform-specific shared library (.dll, .so, or .dylib). Use of a shared library preserves performance optimizations in these functions, but this limits the target platforms for which you can generate code. For more information, see Code Generation for Image Processing.

  • Functions that generate C code or C code that depends on a shared library, depending on which target platform you specify in MATLAB Coder. If you specify the generic MATLAB Host Computer target platform, these functions generate C code that depends on a shared library. If you specify any other target platform, these functions generate C code.

In generated code, each supported toolbox function has the same name, arguments, and functionality as its Image Processing Toolbox counterpart. However, some functions have limitations. The following table includes information about code generation limitations that might exist for each function. In the following table, all the functions generate C code. The table identifies those functions that generate C code that depends on a shared library, and those functions that can do both, depending on which target platform you choose.

FunctionRemarks/Limitations
adaptthresh

The ForegroundPolarity and Statistic arguments must be compile-time constants.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The NeighborhoodSize argument must be a compile-time constant.

affine2d

When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

boundarymask

The conn argument must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bwareaopen

BW must be a 2-D binary image. N-D arrays are not supported. conn can only be one of the two-dimensional connectivities (4 or 8) or a 3-by-3 matrix. The 3-D connectivities (6, 18, and 26) are not supported. Matrices of size 3-by-3-by-...-by-3 are not supported. conn must be a compile-time constant.

MATLAB Function Block support: No.

bwboundaries

The conn and options arguments must be compile-time constants and the return value A can only be a full matrix, not a sparse matrix.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: No.

bwconncomp

The input image must be 2-D.

The conn argument must be a compile-time constant and the only connectivities supported are 4 or 8. You can specify connectivity as a 3-by-3 matrix, but it can only be [0 1 0;1 1 1;0 1 0] or ones(3).

The CC struct return value does not include the PixelIdxList field.

MATLAB Function Block support: No.

bwdist

The method argument must be a compile-time constant. Input images must have fewer than 232 pixels.

Generated code for this function uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bweuler

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bwlabel

When generating code, the parameter n must be a compile-time constant.

MATLAB Function Block support: No.

bwlookup

For best results, specify an input image of class logical.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bwmorph

The text string specifying the operation must be a constant and, for best results, specify an input image of class logical.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: No.

bwpack

Generated code for this function uses a precompiled platform-specific shared library.

MATLAB Function Block support: Yes.

bwperim

Supports only 2-D images. Does not support any no-output-argument syntaxes. The connectivity matrix input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bwselect

Supports only the 3 and 4 input argument syntaxes: BW2 = bwselect(BW,c,r) and BW2 = bwselect(BW,c,r,n). The optional fourth input argument, n, must be a compile-time constant. In addition, with code generation, bwselect only supports only the 1 and 2 output argument  syntaxes: BW2 = bwselect(___) or [BW2, idx] = bwselect(___).

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

bwtraceboundary

The dir, fstep, and conn arguments must be compile-time constants.

MATLAB Function Block support: No.

bwunpack

Generated code for this function uses a precompiled platform-specific shared library.

MATLAB Function Block support: Yes. The input argument M must be a compile-time constant.

conndef

Input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

demosaic

The sensorAlignment argument must be a compile-time constant.

MATLAB Function Block support: Yes.

edge

The method, direction, and sigma arguments must be a compile-time constants. In addition, nonprogrammatic syntaxes are not supported. For example, the syntax edge(im), where edge does not return a value but displays an image instead, is not supported.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input arguments thresh and sigma must be compile-time constants.

fitgeotrans

The transformtype argument must be a compile-time constant. The function supports the following transformation types: 'nonreflectivesimilarity', 'similarity', 'affine', or 'projective'.

MATLAB Function Block support: Yes.

fspecial

Inputs must be compile-time constants. Expressions or variables are allowed if their values do not change.

MATLAB Function Block support: Yes. The input arguments hsize, radius, len, and theta must be compile-time constants.

getrangefromclass

MATLAB Function Block support: Yes.

grayconnectedIf you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

histeq

All the syntaxes that include indexed images are not supported. This includes all syntaxes that accept map as input and return newmap.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument N must be a compile-time constant.

hough

The optional parameter names 'Theta' and 'RhoResolution' must be compile-time string constants. The optional Theta vector must have a bounded size.

MATLAB Function Block support: Yes. The input argument BW must be fixed size, the RhoResolution parameter must be a compile-time constant, and the Theta vector must have a bounded size.

houghlines

The optional parameter names 'FillGap' and 'MinLength' must be compile-time string constants. Their associated values need not be compile-time constants.

MATLAB Function Block support: No.

houghpeaks

The optional parameter names 'Threshold' and 'NHoodSize' must be compile-time string constants. Their associated values need not be compile-time constants.

MATLAB Function Block support: Yes.

im2int16

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

im2uint8

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

im2uint16If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

im2single

MATLAB Function Block support: Yes.

im2double

MATLAB Function Block support: Yes.

imabsdiff

MATLAB Function Block support: Yes.

imadjust

Does not support syntaxes that include indexed images. This includes all syntaxes that accept map as input and return newmap.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imbinarize

String input arguments must be compile-time constants.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imbothat

The input image IM must be either 2-D or 3-D image. The structuring element input argument SE must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imboxfilt

MATLAB Function Block support: Yes.

imclearborder

The optional second input argument, conn, must be a compile-time constant. Supports only up to 3-D inputs.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imclose

The input image IM must be either 2-D or 3-D image. The structuring element input argument SE must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imcomplement

Does not support int64 and uint64 data types.

MATLAB Function Block support: Yes.

imcropThe interactive syntaxes, such as I2 = imcrop, are not supported. Indexed images are not supported, including the noninteractive syntax X2 = imcrop(X,map,rect);.

MATLAB Function Block support: Yes.

imdilate

The input image IM must be either 2-D or 3-D image. The SE, PACKOPT, and SHAPE input arguments must be a compile-time constant. The structuring element argument SE must be a single element—arrays of structuring elements are not supported. To obtain the same result as that obtained using an array of structuring elements, call the function sequentially.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imerode

The input image IM must be either 2-D or 3-D image. The SE, PACKOPT, and SHAPE input arguments must be a compile-time constant. The structuring element argument SE must be a single element—arrays of structuring elements are not supported. To obtain the same result as that obtained using an array of structuring elements, call the function sequentially.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imextendedmax

The optional third input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imextendedmin

The optional third input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imfill

The optional input connectivity, conn and the string 'holes' must be compile-time constants.

Supports only up to 3-D inputs.

The interactive mode to select points, imfill(BW,0,CONN) is not supported in code generation.

locations can be a P-by-1 vector, in which case it contains the linear indices of the starting locations. locations can also be a P-by-ndims(I) matrix, in which case each row contains the array indices of one of the starting locations. Once you select a format at compile-time, you cannot change it at run time. However, the number of points in locations can be varied at run time.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imfilter

The input image can be either 2-D or 3-D. The value of the input argument, options, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imfindcircles

All string input arguments and values must be compile-time constants.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: No.

imgaborfilt

MATLAB Function Block support: No.

imgaussfilt

String input arguments must be compile-time constants.

When FilterDomain is 'spatial', if you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imgradient3

String input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

imgradientxyz

String input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

imhist

The optional second input argument, n, must be a compile-time constant. In addition, nonprogrammatic syntaxes are not supported. For example, the syntaxes where imhist displays the histogram are not supported.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument N must be a compile-time constant.

imhmax

The optional third input argument, conn, must be a compile-time constant

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imhmin

The optional third input argument, conn, must be a compile-time constant

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imlincomb

The output_class argument must be a compile-time constant. You can specify up to four input image arguments.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

immse

MATLAB Function Block support: Yes.

imopen

The input image IM must be either 2-D or 3-D image. The structuring element input argument SE must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imoverlay

If you specify the 'color' argument as a string, it must be a compile-time constant.

MATLAB Function Block support: Yes.

impyramid

The direction argument must be a compile-time constant.

MATLAB Function Block support: Yes. The input argument direction must be a compile-time constant.

imquantize

MATLAB Function Block support: Yes.

imread

Supports reading of 8-bit JPEG images only. The file name input argument must be a valid absolute path or relative path.

This function generates code that uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The file name input argument must be a compile-time constant.

imreconstruct

The optional third input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imref2d

The XWorldLimits, YWorldLimits and ImageSize properties can be set only during object construction. When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

imref3d

The XWorldLimits, YWorldLimits, ZWorldLimits and ImageSize properties can be set only during object construction. When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

imregionalmax

The optional second input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imregionalmin

The optional second input argument, conn, must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imresize

Does not support indexed images or custom interpolation kernels. All parameter-value pair input arguments must be compile-time constants.

MATLAB Function Block support: Yes. The input arguments Scale and method must be compile-time constants, and the values of the OutputSize parameter, numrows and numcols, must be compile-time constants.

imrotate

The method and bbox input argument values must be compile-time constants.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument angle must be a compile-time constant.

imtophat

The input image IM must be either 2-D or 3-D image. The structuring element input argument SE must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

imtranslate

The supports only 2-D translation vectors. 3-D translations are not supported

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument translation must be a compile-time constant.

imwarp

The geometric transformation object input, tform, must be either affine2d or projective2d. Additionally, the interpolation method and optional parameter names must be string constants.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument tform must be a compile-time constant.

integralBoxFilter

The 'NormalizationFactor' parameter must be a compile-time constant.

MATLAB Function Block support: Yes. The input argument filtersize must be a compile-time constant.

intlut

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

iptcheckconn

Input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

iptcheckmap

MATLAB Function Block support: Yes.

lab2rgb

String input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

label2idx

MATLAB Function Block support: No.

label2rgb

Referring to the standard syntax:

RGB = label2rgb(L, map, zerocolor, order)
  • Submit at least two input arguments: the label matrix, L, and the colormap matrix, map.

  • map must be an n-by-3, double, colormap matrix. You cannot use a string containing the name of a MATLAB colormap function or a function handle of a colormap function.

  • If you set the boundary color zerocolor to the same color as one of the regions, label2rgb will not issue a warning.

  • If you supply a value for order, it must be 'noshuffle'.

MATLAB Function Block support: Yes.

mean2

MATLAB Function Block support: Yes.

medfilt2

The padopt argument must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The neighborhood size input argument must be a compile-time constant.

multithresh

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes. The input argument N must be compile-time constant.

offsetstrel

The 'ball' input argument and all other input arguments must be compile-time constants. None of the methods are supported for code generation. When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

ordfilt2

The padopt argument must be a compile-time constant.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

otsuthresh

MATLAB Function Block support: Yes.

padarray

Support only up to 3-D inputs.

Input arguments, padval and direction are expected to be compile-time constants.

MATLAB Function Block support: Yes. The input argument padsize must be a compile-time constant.

projective2d

When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

psnr

MATLAB Function Block support: Yes.

regionprops

Supports only 2-D images. Does not support the table output type. Does not accept cell arrays as input—use a comma-separated list instead. Does not support the properties ConvexArea, ConvexHull, ConvexImage, Solidity, and SubarrayIdx.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: No.

rgb2gray

MATLAB Function Block support: Yes.

rgb2lab

String input arguments must be compile-time constants.

MATLAB Function Block support: Yes.

rgb2ycbcr

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

strel

All of the input arguments must be compile-time constants. None of the methods are supported for code generation. When generating code, you can only specify single objects—arrays of objects are not supported.

MATLAB Function Block support: Yes.

stretchlim

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

superpixels

String input arguments must be compile-time constants. The value of 'IsInputLab' (true or false) must be a compile-time constant.

MATLAB Function Block support: No.

watershed

Supports only 2-D images. Supports only 4- or 8-connectivity. Supports only up to 65,535 regions. The output type is always uint16.

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: No.

ycbcr2rgb

If you choose the generic MATLAB Host Computer target platform, generated code uses a precompiled, platform-specific shared library.

MATLAB Function Block support: Yes.

Input and Output Arguments in MATLAB

Function

Remarks and Limitations

nargin

nargout

  • For a function with no output arguments, returns 1 if called without a terminating semicolon.

    Note:   This behavior also affects extrinsic calls with no terminating semicolon. nargout is 1 for the called function in MATLAB.

Interpolation and Computational Geometry in MATLAB

Function

Remarks and Limitations

cart2pol

cart2sph

interp1

  • Does not support the 'cubic' method. Instead, use 'v5cubic' or 'spline'.

  • The input argument x (sample points) must be strictly increasing or strictly decreasing. Indices are not reordered.

  • If the input argument v (sample values) is a variable-length vector (1-by-: or :-by-1), the shape of the output vq matches the shape in MATLAB.

    If the input argument v is variable-size, is not a variable-length vector, and becomes a row vector at run time, an error occurs.

  • If the input argument xq (query points) is variable-size, is not a variable-length vector, and becomes a row or column vector at run time, an error occurs.

  • Variable-Sizing Restrictions for Code Generation of Toolbox Functions

interp1q

Might not match MATLAB when some Y values are Inf or NaN.

interp2

  • Xq and Yq must be the same size. Use meshgrid to evaluate on a grid.

  • For best results, provide X and Y as vectors.

  • For the 'cubic' method, reports an error if the grid does not have uniform spacing. In this case, use the 'spline' method.

  • For best results when you use the 'spline' method:

    • Use meshgrid to create the inputs Xq and Yq.

    • Use a small number of interpolation points relative to the dimensions of V. Interpolating over a large set of scattered points can be inefficient.

interp3

  • Xq, Yq, and Zq must be the same size. Use meshgrid to evaluate on a grid.

  • For best results, provide X, Y, and Z as vectors.

  • For the 'cubic' method, reports an error if the grid does not have uniform spacing. In this case, use the 'spline' method.

  • For best results when you use the 'spline' method:

    • Use meshgrid to create the inputs Xq, Yq, and Zq.

    • Use a small number of interpolation points relative to the dimensions of V. Interpolating over a large set of scattered points can be inefficient.

interpn

  • For best results, provide X1,X2,...,Xn as vectors.

  • Does not support the 'cubic' or 'spline' methods for 2-D and higher interpolation.

  • The interpolation method must be a constant string.

meshgrid

mkpp

  • The output structure pp differs from the pp structure in MATLAB. In MATLAB, ppval cannot use the pp structure from the code generation software. For code generation, ppval cannot use a pp structure created by MATLAB. unmkpp can use a MATLAB pp structure for code generation.

    To create a MATLAB pp structure from a pp structure created by the code generation software:

    • In code generation, use unmkpp to return the piecewise polynomial details to MATLAB.

    • In MATLAB, use mkpp to create the pp structure.

  • If you do not provide d, then coefs must be two-dimensional and have a fixed number of columns. In this case, the number of columns is the order.

  • To define a piecewise constant polynomial, coefs must be a column vector or d must have at least two elements.

  • If you provide d and d is 1, d must be a constant. Otherwise, if the input to ppval is nonscalar, the shape of the output of ppval can differ from ppval in MATLAB.

  • If you provide d, it must have a fixed length. One of the following sets of statements must be true:

    1. Suppose that m = length(d) and npieces = length(breaks) - 1.

      size(coefs,j) = d(j) 
      size(coefs,m+1) = npieces
      size(coefs,m+2) = order 
      j = 1,2,...,m. The dimension m+2 must be fixed length.

    2. Suppose that m = length(d) and npieces = length(breaks) - 1.

      size(coefs,1) = prod(d)*npieces
      size(coefs,2) = order             
      The second dimension must be fixed length.

  • If you do not provide d, the following statements must be true:

    Suppose that m = length(d) and npieces = length(breaks) - 1.

    size(coefs,1) = prod(d)*npieces
    size(coefs,2) = order
    The second dimension must be fixed length.

pchip

  • Input x must be strictly increasing.

  • Does not remove y entries with NaN values.

  • If you generate code for the pp = pchip(x,y) syntax, you cannot input pp to the ppval function in MATLAB. To create a MATLAB pp structure from a pp structure created by the code generation software:

    • In code generation, use unmkpp to return the piecewise polynomial details to MATLAB.

    • In MATLAB, use mkpp to create the pp structure.

pol2cart

polyarea

ppval

The size of output v does not match MATLAB when both of the following statements are true:

  • The input x is a variable-size array that is not a variable-length vector.

  • x becomes a row vector at run time.

The code generation software does not remove the singleton dimensions. However, MATLAB might remove singleton dimensions.

For example, suppose that x is a :4-by-:5 array (the first dimension is variable size with an upper bound of 4 and the second dimension is variable size with an upper bound of 5). Suppose that ppval(pp,0) returns a 2-by-3 fixed-size array. v has size 2-by-3-by-:4-by-:5. At run time, suppose that, size(x,1) =1 and size (x,2) = 5. In the generated code, the size(v) is [2,3,1,5]. In MATLAB, the size is [2,3,5].

rectint

sph2cart

spline

  • Input x must be strictly increasing.

  • Does not remove Y entries with NaN values.

  • Does not report an error for infinite endslopes in Y.

  • If you generate code for the pp = spline(x,Y) syntax, you cannot input pp to the ppval function in MATLAB. To create a MATLAB pp structure from a pp structure created by the code generation software:

    • In code generation, use unmkpp to return the piecewise polynomial details to MATLAB.

    • In MATLAB, use mkpp to create the pp structure.

unmkpp

  • pp must be a valid piecewise polynomial structure created by mkpp, spline, or pchip in MATLAB or by the code generation software.

  • Does not support pp structures created by interp1 in MATLAB.

Linear Algebra in MATLAB

FunctionRemarks and Limitations

bandwidth

isbanded

isdiag

ishermitian

istril

istriu

issymmetric

linsolve

  • The option structure must be a constant.

  • Supports only a scalar option structure input. It does not support arrays of option structures.

  • Only optimizes these cases:

    • UT

    • LT

    • UHESS = true (the TRANSA can be either true or false)

    • SYM = true and POSDEF = true

    Other options are equivalent to using mldivide.

lsqnonneg

  • You must enable support for variable-size arrays.

  • The message string in the output structure output (the fifth output) is not translated.

null

  • Might return a different basis than MATLAB

  • Does not support rational basis option (second input)

orth

  • Can return a different basis than MATLAB

rsf2csf

schur

Can return a different Schur decomposition in generated code than in MATLAB.

sqrtm

Logical and Bit-Wise Operations in MATLAB

FunctionRemarks and Limitations

and

bitand

bitcmp

bitget

bitor

bitset

bitshift

bitxor

not

or

xor

MATLAB Compiler

C and C++ code generation for the following functions requires the MATLAB Compiler™ software.

Function

Remarks and Limitations

isdeployed

  • Returns true and false as appropriate for MEX and SIM targets

  • Returns false for other targets

ismcc

  • Returns true and false as appropriate for MEX and SIM targets.

  • Returns false for other targets.

Matrices and Arrays in MATLAB

Function

Remarks and Limitations

abs

all

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

angle

any

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

blkdiag

bsxfun

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

cat

circshift

Does not support cell arrays for the first argument.

colon

  • Does not accept complex inputs.

  • The input i cannot have a logical value.

  • Does not accept vector inputs.

  • Inputs must be constants.

  • Uses single-precision arithmetic to produce single-precision results.

compan

cond

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

cov

cross

cumprod

Does not support logical inputs. Cast input to double first.

cumsum

Does not support logical inputs. Cast input to double first.

det

diag

  • If supplied, the argument representing the order of the diagonal matrix must be a real and scalar integer value.

  • For variable-size inputs that are variable-length vectors (1-by-: or :-by-1), diag:

    • Treats the input as a vector input.

    • Returns a matrix with the given vector along the specified diagonal.

  • For variable-size inputs that are not variable-length vectors, diag:

    • Treats the input as a matrix.

    • Does not support inputs that are vectors at run time.

    • Returns a variable-length vector.

    If the input is variable-size (:m-by-:n) and has shape 0-by-0 at run time, the output is 0-by-1 not 0-by-0. However, if the input is a constant size 0-by-0, the output is [].

  • For variable-size inputs that are not variable-length vectors (1-by-: or :-by-1), diag treats the input as a matrix from which to extract a diagonal vector. This behavior occurs even if the input array is a vector at run time. To force diag to build a matrix from variable-size inputs that are not 1-by-: or :-by-1, use:

    • diag(x(:)) instead of diag(x)

    • diag(x(:),k) instead of diag(x,k)

  • Variable-Sizing Restrictions for Code Generation of Toolbox Functions

diff

dot

eig

  • For code generation,QZ algorithm is used in all cases. MATLAB can use different algorithms for different inputs. Consequently, V might represent a different basis of eigenvectors. The eigenvalues in D might not be in the same order as in MATLAB.

  • With one input, [V,D] = eig(A), the results are similar to those obtained using [V,D] = eig(A,eye(size(A)),'qz') in MATLAB, except that the columns of V are normalized.

  • Options 'balance', and 'nobalance' are not supported for the standard eigenvalue problem. 'chol' is not supported for the symmetric generalized eigenvalue problem.

  • Outputs are of complex type.

  • Does not support the option to calculate left eigenvectors.

eye

  • classname must be a built-in MATLAB numeric type. Does not invoke the static eye method for other classes. For example, eye(m, n, 'myclass') does not invoke myclass.eye(m,n).

  • Size arguments must have a fixed size.

false

  • Dimensions must be real, nonnegative, integers.

find

  • Issues an error if a variable-size input becomes a row vector at run time.

      Note:   This limitation does not apply when the input is scalar or a variable-length row vector.

  • For variable-size inputs, the shape of empty outputs, 0-by-0, 0-by-1, or 1-by-0, depends on the upper bounds of the size of the input. The output might not match MATLAB when the input array is a scalar or [] at run time. If the input is a variable-length row vector, the size of an empty output is 1-by-0, otherwise it is 0-by-1.

  • Always returns a variable-length vector. Even when you provide the output vector k, the output cannot be fixed-size because the output can contain fewer than k elements. For example, find(x,1) returns a variable-length vector with 1 or 0 elements.

flip

Does not support cell arrays for the first argument.

flipdim

Does not support cell arrays for the first argument.

fliplr

Does not support cell arrays.

flipud

Does not support cell arrays.

full

hadamard

n must be a fixed-size scalar.

hankel

hilb

ind2sub

inv

Singular matrix inputs can produce nonfinite values that differ from MATLAB results.

invhilb

ipermute

iscolumn

isempty

isequal

isequaln

isfinite

isfloat

isinf

isinteger

islogical

ismatrix

isnan

isrow

issparse

isvector

kron

length

linspace

logspace

lu

magic

Variable-Sizing Restrictions for Code Generation of Toolbox Functions.

max

min

ndgrid

ndims

nnz

nonzeros

norm

normest

numel

ones

  • Dimensions must be real, nonnegative integers.

  • The input optimfun must be a function supported for code generation.

pascal

permute

pinv

planerot

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

prod

qr

rand

randi

randn

randperm

rank

rcond

repmat

Size arguments must have a fixed size.

reshape

rng

  • Supports only the 'twister', 'v5normal', and 'v4' generators.

  • Does not support the 'shuffle' input.

  • For a MEX target:

    • If extrinsic calls are disabled or rng is called inside a parfor loop, the output of rng in the MEX function is not compatible with the rng function in MATLAB. You cannot pass the output of s = rng from the MEX function to rng in MATLAB.

    • If extrinsic calls are enabled and rng is not called from inside a parfor loop, only rng can access the data in the structure that rng returns.

rosser

rot90

Does not support cell arrays for the first argument.

shiftdim

sign

size

sort

  • Does not support cell arrays for the first argument.

  • If the input is a complex type, sort orders the output according to absolute value. When x is a complex type that has all zero imaginary parts, use sort(real(x)) to compute the sort order for real types. See Code Generation for Complex Data with Zero-Valued Imaginary Parts.

sortrows

  • Does not support cell arrays for the first argument.

  • If the input is a complex type, sortrows orders the output according to absolute value. When x is a complex type that has all zero imaginary parts, use sortrows(real(x)) to compute the sort order for real types. See Code Generation for Complex Data with Zero-Valued Imaginary Parts.

squeeze

Does not support cell arrays.

sub2ind

subspace

sum

toeplitz

trace

tril

  • If supplied, the argument representing the order of the diagonal matrix must be a real and scalar integer value.

triu

  • If supplied, the argument representing the order of the diagonal matrix must be a real and scalar integer value.

true

  • Dimensions must be real, nonnegative, integers.

vander

wilkinson

n must be a fixed-size scalar.

zeros

  • Dimensions must be real, nonnegative, integers.

Neural Network Toolbox

You can use genFunction in the Neural Network Toolbox™ to generate a standalone MATLAB function for a trained neural network. You can generate C/C++ code from this standalone MATLAB function. To generate Simulink blocks, use thegenSim function. See Deploy Neural Network Functions.

Numerical Integration and Differentiation in MATLAB

Function

Remarks and Limitations

cumtrapz

del2

diff

  • If supplied, the arguments representing the number of times to apply diff and the dimension along which to calculate the difference must be constants.

gradient

ode23

  • All odeset option arguments must be constant.

  • Does not support a constant mass matrix in the options structure. Provide a mass matrix as a function .

  • You must provide at least the two output arguments T and Y.

  • Input types must be homogeneous—all double or all single.

  • Variable-sizing support must be enabled. Requires dynamic memory allocation when tspan has two elements or you use event functions.

ode45

  • All odeset option arguments must be constant.

  • Does not support a constant mass matrix in the options structure. Provide a mass matrix as a function .

  • You must provide at least the two output arguments T and Y.

  • Input types must be homogeneous—all double or all single.

  • Variable-sizing support must be enabled. Requires dynamic memory allocation when tspan has two elements or you use event functions.

odeget

The name argument must be constant.

odeset

All inputs must be constant.

quad2d

  • Generates a warning if the size of the internal storage arrays is not large enough. If a warning occurs, a possible workaround is to divide the region of integration into pieces and sum the integrals over each piece.

quadgk

trapz

Optimization Functions in MATLAB

Function

Remarks and Limitations

fminsearch

  • Ignores the Display option. Does not print status information during execution. Test the exitflag output for the exit condition.

  • The output structure does not include the algorithm or message fields.

  • Ignores the OutputFcn and PlotFcns options.

fzero

  • The first argument must be a function handle. Does not support structure, inline function, or string inputs for the first argument.

  • Supports up to three output arguments. Does not support the fourth output argument (the output structure).

optimget

Input parameter names must be constant.

optimset

  • Does not support the syntax that has no input or output arguments:

    optimset

  • Functions specified in the options must be supported for code generation.

  • The fields of the options structure oldopts must be fixed-size fields.

  • For code generation, optimization functions ignore the Display option.

  • Does not support the additional options in an options structure created by the Optimization Toolbox™ optimset function. If an input options structure includes the additional Optimization Toolbox options, the output structure does not include them.

Phased Array System Toolbox

C and C++ code generation for the following functions and System objects requires the Phased Array System Toolbox™ software.

NameRemarks and Limitations
Antenna and Microphone Elements

aperture2gain

Does not support variable-size inputs.

azel2phithetapat

Does not support variable-size inputs.

azel2uvpat

Does not support variable-size inputs.

circpol2pol

Does not support variable-size inputs.

gain2aperture

Does not support variable-size inputs.

phased.CosineAntennaElement
phased.CrossedDipoleAntennaElement
phased.CustomAntennaElement
phased.CustomMicrophoneElement
phased.IsotropicAntennaElement
phased.OmnidirectionalMicrophoneElement
phased.ShortDipoleAntennaElement

phitheta2azelpat

Does not support variable-size inputs.

phitheta2uvpat

Does not support variable-size inputs.

pol2circpol

Does not support variable-size inputs.

polellip

Does not support variable-size inputs.

polloss

Does not support variable-size inputs.

polratio

Does not support variable-size inputs.

polsignature

  • Does not support variable-size inputs.

  • Supported only when output arguments are specified.

stokes

  • Does not support variable-size inputs.

  • Supported only when output arguments are specified.

uv2azelpat

Does not support variable-size inputs.

uv2phithetapat

Does not support variable-size inputs.

Array Geometries and Analysis

az2broadside

Does not support variable-size inputs.

broadside2az

Does not support variable-size inputs.

pilotcalib

Does not support variable-size inputs.

phased.ArrayGain
  • Does not support arrays containing polarized antenna elements, that is, the phased.ShortDipoleAntennaElement or phased.CrossedDipoleAntennaElement antennas.

  • See System Objects in MATLAB Code Generation.

phased.ArrayResponseSee System Objects in MATLAB Code Generation.
phased.ConformalArray
phased.ElementDelaySee System Objects in MATLAB Code Generation.
phased.PartitionedArray
phased.ReplicatedSubarray
phased.SteeringVectorSee System Objects in MATLAB Code Generation.
phased.UCA
phased.ULA
phased.URA
Signal Radiation and Collection
phased.CollectorSee System Objects in MATLAB Code Generation.
phased.Radiator See System Objects in MATLAB Code Generation.
phased.WidebandCollector
phased.WidebandRadiatorSee System Objects in MATLAB Code Generation.

sensorsig

Does not support variable-size inputs.

Transmitters and Receivers

delayseq

Does not support variable-size inputs.

noisepow

Does not support variable-size inputs.

phased.ReceiverPreampSee System Objects in MATLAB Code Generation.
phased.TransmitterSee System Objects in MATLAB Code Generation.

systemp

Does not support variable-size inputs.

Waveform Design and Analysis

ambgfun

Does not support variable-size inputs.

phased.FMCWWaveform.
phased.LinearFMWaveform
phased.MFSKWaveform
phased.PhaseCodedWaveform
phased.RectangularWaveform
phased.SteppedFMWaveform

range2bw

Does not support variable-size inputs.

range2time

Does not support variable-size inputs.

time2range

Does not support variable-size inputs.

unigrid

Does not support variable-size inputs.

Beamforming

cbfweights

Does not support variable-size inputs.

lcmvweights

Does not support variable-size inputs.

mvdrweights

Does not support variable-size inputs.

phased.FrostBeamformer
phased.LCMVBeamformerSee System Objects in MATLAB Code Generation.
phased.MVDRBeamformerSee System Objects in MATLAB Code Generation.
phased.PhaseShiftBeamformerSee System Objects in MATLAB Code Generation.
phased.SteeringVectorSee System Objects in MATLAB Code Generation.
phased.SubbandMVDRBeamformerSee System Objects in MATLAB Code Generation.
phased.SubbandPhaseShiftBeamformerSee System Objects in MATLAB Code Generation.
phased.TimeDelayBeamformer
phased.TimeDelayLCMVBeamformer

sensorcov

Does not support variable-size inputs.

steervec

Does not support variable-size inputs.

Direction of Arrival (DOA) Estimation

aictest

Does not support variable-size inputs.

espritdoa

Does not support variable-size inputs.

gccphat

Does not support variable-size inputs.

mdltest

Does not support variable-size inputs.

phased.BeamscanEstimatorSee System Objects in MATLAB Code Generation.
phased.BeamscanEstimator2DSee System Objects in MATLAB Code Generation.
phased.BeamspaceESPRITEstimatorSee System Objects in MATLAB Code Generation.
phased.ESPRITEstimatorSee System Objects in MATLAB Code Generation.
phased.GCCEstimatorSee System Objects in MATLAB Code Generation.
phased.MVDREstimatorSee System Objects in MATLAB Code Generation.
phased.MVDREstimator2DSee System Objects in MATLAB Code Generation.
phased.RootMUSICEstimatorSee System Objects in MATLAB Code Generation.
phased.RootWSFEstimatorSee System Objects in MATLAB Code Generation.
phased.SumDifferenceMonopulseTrackerSee System Objects in MATLAB Code Generation.
phased.SumDifferenceMonopulseTracker2DSee System Objects in MATLAB Code Generation.

rootmusicdoa

Does not support variable-size inputs.

spsmooth

Does not support variable-size inputs.

Space-Time Adaptive Processing (STAP)

dopsteeringvec

Does not support variable-size inputs.

phased.ADPCACancellerSee System Objects in MATLAB Code Generation.
phased.AngleDopplerResponseSee System Objects in MATLAB Code Generation.
phased.DPCACancellerSee System Objects in MATLAB Code Generation.
phased.STAPSMIBeamformerSee System Objects in MATLAB Code Generation.

val2ind

Does not support variable-size inputs.

Targets, Interference, and Signal Propagation

billingsleyicm

Does not support variable-size inputs.

depressionang

Does not support variable-size inputs.

effearthradius

Does not support variable-size inputs.

fspl

Does not support variable-size inputs.

fogpl

Does not support variable-size inputs.

gaspl

Does not support variable-size inputs.

grazingang

Does not support variable-size inputs.

horizonrange

Does not support variable-size inputs.

phased.BackscatterRadarTargetSee System Objects in MATLAB Code Generation
phased.BarrageJammerSee System Objects in MATLAB Code Generation.
phased.ConstantGammaClutterSee System Objects in MATLAB Code Generation.
phased.FreeSpace
phased.LOSChannelSee System Objects in MATLAB Code Generation
phased.RadarTargetSee System Objects in MATLAB Code Generation.
phased.TwoRayChannelSee System Objects in MATLAB Code Generation.
phased.WidebandFreeSpaceSee System Objects in MATLAB Code Generation.
phased.WidebandLOSChannelSee System Objects in MATLAB Code Generation

physconst

Does not support variable-size inputs.

surfacegamma

Does not support variable-size inputs.

surfclutterrcs

Does not support variable-size inputs.

rainpl

Does not support variable-size inputs.

Motion Modeling and Coordinate Systems

azel2phitheta

Does not support variable-size inputs.

azel2uv

Does not support variable-size inputs.

azelaxes

Does not support variable-size inputs.

cart2sphvec

Does not support variable-size inputs.

dop2speed

Does not support variable-size inputs.

global2localcoord

Does not support variable-size inputs.

local2globalcoord

Does not support variable-size inputs.

phased.PlatformSee System Objects in MATLAB Code Generation.

phitheta2azel

Does not support variable-size inputs.

phitheta2uv

Does not support variable-size inputs.

radialspeed

Does not support variable-size inputs.

rangeangle

Does not support variable-size inputs.

rotx

Does not support variable-size inputs.

roty

Does not support variable-size inputs

rotz

Does not support variable-size inputs.

speed2dop

Does not support variable-size inputs.

sph2cartvec

Does not support variable-size inputs.

uv2azel

Does not support variable-size inputs.

Polynomials in MATLAB

Function

Remarks and Limitations

poly

polyder

The output can contain fewer NaNs than the MATLAB output. However, if the input contains a NaN, the output contains at least one NaN.

polyfit

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

polyint

polyval

polyvalm

roots

  • Output is variable size.

  • Output is complex.

  • Roots are not always in the same order as MATLAB.

  • Roots of poorly conditioned polynomials do not always match MATLAB.

Programming Utilities in MATLAB

Function

Remarks and Limitations

mfilename

Relational Operators in MATLAB

Function

Remarks and Limitations

eq

ge

gt

le

lt

ne

Robotics System Toolbox

C/C++ code generation for the following functions requires the Robotics System Toolbox™ software.

NameRemarks and Limitations
Algorithm Design
robotics.PurePursuit

Supports MATLAB Function block: No

robotics.VectorFieldHistogram

Supports MATLAB Function block: No

robotics.ParticleFilter

Supports MATLAB Function block: No

Coordinate System Transformations
angdiff

Supports MATLAB Function block: Yes

axang2quat

Supports MATLAB Function block: Yes

axang2rotm

Supports MATLAB Function block: Yes

axang2tform

Supports MATLAB Function block: Yes

cart2hom

Supports MATLAB Function block: Yes

eul2quat

Supports MATLAB Function block: Yes

eul2rotm

Supports MATLAB Function block: Yes

eul2tform

Supports MATLAB Function block: Yes

hom2cart

Supports MATLAB Function block: Yes

quat2axang

Supports MATLAB Function block: Yes

quat2eul

Supports MATLAB Function block: Yes

quat2rotm

Supports MATLAB Function block: Yes

quat2tform

Supports MATLAB Function block: Yes

rotm2axang

Supports MATLAB Function block: Yes

rotm2eul

Supports MATLAB Function block: Yes

rotm2quat

Supports MATLAB Function block: Yes

rotm2tform

Supports MATLAB Function block: Yes

tform2axang

Supports MATLAB Function block: Yes

tform2eul

Supports MATLAB Function block: Yes

tform2quat

Supports MATLAB Function block: Yes

tform2rotm

Supports MATLAB Function block: Yes

tform2trvec

Supports MATLAB Function block: Yes

trvec2tform

Supports MATLAB Function block: Yes

Rounding and Remainder Functions in MATLAB

Function

Remarks and Limitations

ceil

fix

floor

mod

  • Performs the arithmetic using the output class. Results might not match MATLAB due to differences in rounding errors.

    If one of the inputs has type int64 or uint64, then both inputs must have the same type.

rem

  • Performs the arithmetic using the output class. Results might not match MATLAB due to differences in rounding errors.

  • If one of the inputs has type int64 or uint64, then both inputs must have the same type.

round

Supports only the syntax Y = round(X).

Set Operations in MATLAB

Function

Remarks and Limitations

intersect

  • Does not support cell arrays for the first or second arguments.

  • When you do not specify the 'rows' option:

    • Inputs A and B must be vectors. If you specify the 'legacy' option, inputs A and B must be row vectors.

    • The first dimension of a variable-size row vector must have fixed length 1. The second dimension of a variable-size column vector must have fixed length 1.

    • The input [] is not supported. Use a 1-by-0 or 0-by-1 input, for example, zeros(1,0), to represent the empty set.

    • If you specify the 'legacy' option, empty outputs are row vectors, 1-by-0, never 0-by-0.

  • When you specify both the 'legacy' option and the 'rows' option, the outputs ia and ib are column vectors. If these outputs are empty, they are 0-by-1, never 0-by-0, even if the output C is 0-by-0.

  • When the setOrder is 'sorted' or when you specify the 'legacy' option, the inputs must already be sorted in ascending order. The first output, C, is sorted in ascending order.

  • Complex inputs must be single or double.

  • When one input is complex and the other input is real, do one of the following:

    • Set setOrder to 'stable'.

    • Sort the real input in complex ascending order (by absolute value). Suppose the real input is x. Use sort(complex(x))or sortrows(complex(x)).

  • Code Generation for Complex Data with Zero-Valued Imaginary Parts.

ismember

issorted

setdiff

  • Does not support cell arrays for the first or second arguments.

  • When you do not specify the 'rows' option:

    • Inputs A and B must be vectors. If you specify the 'legacy' option, inputs A and B must be row vectors.

    • The first dimension of a variable-size row vector must have fixed length 1. The second dimension of a variable-size column vector must have fixed length 1.

    • Do not use [] to represent the empty set. Use a 1-by-0 or 0-by-1 input, for example, zeros(1,0), to represent the empty set.

    • If you specify the 'legacy' option, empty outputs are row vectors, 1-by-0, never 0-by-0.

  • When you specify both the 'legacy' and 'rows' options, the output ia is a column vector. If ia is empty, it is 0-by-1, never 0-by-0, even if the output C is 0-by-0.

  • When the setOrder is not 'stable' or when you specify the 'legacy' option, the inputs must already be sorted in ascending order. The first output, C, is sorted in ascending order.

  • Complex inputs must be single or double.

  • When one input is complex and the other input is real, do one of the following:

    • Set setOrder to 'stable'.

    • Sort the real input in complex ascending order (by absolute value). Suppose the real input is x. Use sort(complex(x))or sortrows(complex(x)).

  • Code Generation for Complex Data with Zero-Valued Imaginary Parts.

setxor

  • Does not support cell arrays for the first or second arguments.

  • When you do not specify the 'rows' option:

    • Inputs A and B must be vectors with the same orientation. If you specify the 'legacy' option, inputs A and B must be row vectors.

    • The first dimension of a variable-size row vector must have fixed length 1. The second dimension of a variable-size column vector must have fixed length 1.

    • The input [] is not supported. Use a 1-by-0 or 0-by-1 input, for example , zeros(1,0), to represent the empty set.

    • If you specify the 'legacy' option, empty outputs are row vectors, 1-by-0, never 0-by-0.

  • When you specify both the 'legacy' option and the 'rows' option, the outputs ia and ib are column vectors. If these outputs are empty, they are 0-by-1, never 0-by-0, even if the output C is 0-by-0.

  • When the setOrder is not 'stable' or when you specify the 'legacy' flag, the inputs must already be sorted in ascending order. The first output, C, is sorted in ascending order.

  • Complex inputs must be single or double.

  • When one input is complex and the other input is real, do one of the following:

    • Set setOrder to 'stable'.

    • Sort the real input in complex ascending order (by absolute value). Suppose the real input is x. Use sort(complex(x))or sortrows(complex(x)).

  • Code Generation for Complex Data with Zero-Valued Imaginary Parts.

union

  • Does not support cell arrays for the first or second arguments.

  • When you do not specify the 'rows' option:

    • Inputs A and B must be vectors with the same orientation. If you specify the 'legacy' option, inputs A and B must be row vectors.

    • The first dimension of a variable-size row vector must have fixed length 1. The second dimension of a variable-size column vector must have fixed length 1.

    • The input [] is not supported. Use a 1-by-0 or 0-by-1 input, for example , zeros(1,0), to represent the empty set.

    • If you specify the 'legacy' option, empty outputs are row vectors, 1-by-0, never 0-by-0.

  • When you specify both the 'legacy' option and the 'rows' option, the outputs ia and ib are column vectors. If these outputs are empty, they are 0-by-1, never 0-by-0, even if the output C is 0-by-0.

  • When the setOrder is not 'stable' or when you specify the 'legacy' option, the inputs must already be sorted in ascending order. The first output, C, is sorted in ascending order.

  • Complex inputs must be single or double.

  • When one input is complex and the other input is real, do one of the following:

    • Set setOrder to 'stable'.

    • Sort the real input in complex ascending order (by absolute value). Suppose the real input is x. Use sort(complex(x))or sortrows(complex(x)).

  • Code Generation for Complex Data with Zero-Valued Imaginary Parts.

unique

  • Does not support cell arrays for the first argument.

  • When you do not specify the'rows' option:

    • The input A must be a vector. If you specify the 'legacy' option, the input A must be a row vector.

    • The first dimension of a variable-size row vector must have fixed length 1. The second dimension of a variable-size column vector must have fixed length 1.

    • The input [] is not supported. Use a 1-by-0 or 0-by-1 input, for example, zeros(1,0), to represent the empty set.

    • If you specify the 'legacy' option, empty outputs are row vectors, 1-by-0, never 0-by-0.

  • When you specify both the 'rows' option and the 'legacy'option, outputs ia and ic are column vectors. If these outputs are empty, they are 0-by-1, even if the output C is 0-by-0.

  • When the setOrder is not 'stable' or when you specify the 'legacy' option, the input A must already be sorted in ascending order. The first output, C, is sorted in ascending order.

  • Complex inputs must be single or double.

Signal Processing in MATLAB

FunctionRemarks and Limitations

chol

conv

fft

fft2

fftn

The siz argument must have a fixed size.

fftshift

filter

  • If supplied, dim must be a constant.

  • v

freqspace

ifft

ifft2

Does not support the 'symmetric' option.

ifftn

  • Does not support the 'symmetric' option.

  • The siz argument must have a fixed size.

ifftshift

svd

Uses a different SVD implementation than MATLAB. Because the singular value decomposition is not unique, left and right singular vectors might differ from those computed by MATLAB.

zp2tf

Signal Processing Toolbox

C and C++ code generation for the following functions requires the Signal Processing Toolbox™ software. These functions do not support variable-size inputs, you must define the size and type of the function inputs. For more information, see Specifying Inputs in Code Generation from MATLAB .

    Note:   Many Signal Processing Toolbox functions require constant inputs in generated code. To specify a constant input for codegen, use coder.Constant.

Function Remarks/Limitations

barthannwin

Window length must be a constant. Expressions or variables are allowed if their values do not change.

bartlett

Window length must be a constant. Expressions or variables are allowed if their values do not change.

besselap

Filter order must be a constant. Expressions or variables are allowed if their values do not change.

bitrevorder

blackman

Window length must be a constant. Expressions or variables are allowed if their values do not change.

blackmanharris

Window length must be a constant. Expressions or variables are allowed if their values do not change.

bohmanwin

Window length must be a constant. Expressions or variables are allowed if their values do not change.

buttap

Filter order must be a constant. Expressions or variables are allowed if their values do not change.

butter

Filter coefficients must be constants. Expressions or variables are allowed if their values do not change.

buttord

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cfirpm

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cheb1ap

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cheb2ap

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cheb1ord

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cheb2ord

All inputs must be constants. Expressions or variables are allowed if their values do not change.

chebwin

All inputs must be constants. Expressions or variables are allowed if their values do not change.

cheby1

All Inputs must be constants. Expressions or variables are allowed if their values do not change.

cheby2

All inputs must be constants. Expressions or variables are allowed if their values do not change.

db2pow

dct

C and C++ code generation for dct requires DSP System Toolbox software.

Length of transform dimension must be a power of two. If specified, the pad or truncation value must be constant. Expressions or variables are allowed if their values do not change.

downsample

dpss

All inputs must be constants. Expressions or variables are allowed if their values do not change.

ellip

Inputs must be constant. Expressions or variables are allowed if their values do not change.

ellipap

All inputs must be constants. Expressions or variables are allowed if their values do not change.

ellipord

All inputs must be constants. Expressions or variables are allowed if their values do not change.

filtfilt

Filter coefficients must be constants. Expressions or variables are allowed if their values do not change.

findpeaks

fir1

All inputs must be constants. Expressions or variables are allowed if their values do not change.

fir2

All inputs must be constants. Expressions or variables are allowed if their values do not change.

fircls

All inputs must be constants. Expressions or variables are allowed if their values do not change.

fircls1

All inputs must be constants. Expressions or variables are allowed if their values do not change.

firls

All inputs must be constants. Expressions or variables are allowed if their values do not change.

firpm

All inputs must be constants. Expressions or variables are allowed if their values do not change.

firpmord

All inputs must be constants. Expressions or variables are allowed if their values do not change.

flattopwin

All inputs must be constants. Expressions or variables are allowed if their values do not change.

freqz

  • Does not support variable-size inputs.

  • When called with no output arguments, and without a semicolon at the end, freqz returns the complex frequency response of the input filter, evaluated at 512 points.

    If the semicolon is added, the function produces a plot of the magnitude and phase response of the filter.

    See freqz With No Output Arguments.

gausswin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

hamming

All inputs must be constant. Expressions or variables are allowed if their values do not change.

hann

All inputs must be constant. Expressions or variables are allowed if their values do not change.

idct

C and C++ code generation for idct requires DSP System Toolbox software.

Length of transform dimension must be a power of two. If specified, the pad or truncation value must be constant. Expressions or variables are allowed if their values do not change.

intfilt

All inputs must be constant. Expressions or variables are allowed if their values do not change.

kaiser

All inputs must be constant. Expressions or variables are allowed if their values do not change.

kaiserord

levinson

C and C++ code generation for levinson requires DSP System Toolbox software.

If specified, the order of recursion must be a constant. Expressions or variables are allowed if their values do not change.

maxflat

All inputs must be constant. Expressions or variables are allowed if their values do not change.

nuttallwin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

parzenwin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

peak2peak

peak2rms

pow2db

rcosdesign

All inputs must be constant. Expressions or variables are allowed if their values do not change.

rectwin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

resample

C and C++ code generation for resample requires DSP System Toolbox software.

The upsampling and downsampling factors must be specified as constants. Expressions or variables are allowed if their values do not change.

rms

sgolay

All inputs must be constant. Expressions or variables are allowed if their values do not change.

sosfilt

taylorwin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

triang

All inputs must be constant. Expressions or variables are allowed if their values do not change.

tukeywin

All inputs must be constant. Expressions or variables are allowed if their values do not change.

upfirdn

C and C++ code generation for upfirdn requires DSP System Toolbox software.

Filter coefficients, upsampling factor, and downsampling factor must be constants. Expressions or variables are allowed if their values do not change.

Variable-size inputs are not supported.

upsample

Either declare input n as constant, or use the assert function in the calling function to set upper bounds for n. For example,

assert(n<10)

xcorr

Leading ones in size(x) must be constant for every input x. If x is variable-size and is a row vector, it must be 1-by-:. It cannot be :-by-: with size(x,1) = 1 at run time.

yulewalk

If specified, the order of recursion must be a constant. Expressions or variables are allowed if their values do not change.

Special Values in MATLAB

Function

Remarks and Limitations

eps

  • Supported for scalar fixed-point signals only.

  • Supported for scalar, vector, and matrix, fi single and fi double signals.

inf

  • Dimensions must be real, nonnegative, integers.

intmax

intmin

NaN or nan

  • Dimensions must be real, nonnegative, integers.

pi

realmax

realmin

Specialized Math in MATLAB

Function

Remarks and Limitations

airy

Always returns a complex result.

besseli

  • If the order nu is less than 0, it must be an integer.

  • Always returns a complex result.

besselj

  • If the order nu is less than 0, it must be an integer.

  • Always returns a complex result.

beta

betainc

Always returns a complex result.

betaincinv

Always returns a complex result.

betaln

ellipke

erf

erfc

erfcinv

erfcx

erfinv

expint

gamma

gammainc

Output is always complex.

gammaincinv

Output is always complex.

gammaln

psi

Statistics in MATLAB

Function

Remarks and Limitations

corrcoef

  • Row-vector input is only supported when the first two inputs are vectors and nonscalar.

cummin

cummax

mean

median

mode

std

var

Statistics and Machine Learning Toolbox

C and C++ code generation for the following functions requires the Statistics and Machine Learning Toolbox™ software.

Function

Remarks and Limitations

betacdf

betafit

betainv

betalike

betapdf

betarnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

betastat

binocdf

binoinv

binopdf

binornd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

binostat

cdf

chi2cdf

chi2inv

chi2pdf

chi2rnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

chi2stat

evcdf

evinv

evpdf

evrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

evstat

expcdf

expinv

exppdf

exprnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

expstat

fcdf

finv

fpdf

frnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

fstat

gamcdf

gaminv

gampdf

gamrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

gamstat

geocdf

geoinv

geomean

geopdf

geornd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

geostat

gevcdf

gevinv

gevpdf

gevrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

gevstat

gpcdf

gpinv

gppdf

gprnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

gpstat

harmmean

hygecdf

hygeinv

hygepdf

hygernd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

hygestat

icdf

iqr

kmeans

  • If the Start method uses random selections, the initial centroid cluster positions might not match MATLAB.

  • If the number of rows in X is fixed, does not remove rows of X that contain a NaN.

  • The cluster centroid locations in C can have a different order than in MATLAB. In this case, the cluster indices in idx have corresponding differences.

  • If you provide Display, its value must be 'off'.

  • If you provide Streams, it must be empty and UseSubstreams must be false.

  • When you set the UseParallel option to true, some computations can execute in parallel even when Replicates is 1. For large data sets, when Replicates is 1, consider setting the UseParallel option to true.

kurtosis

logncdf

logninv

lognpdf

lognrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

lognstat

mad

Input dim cannot be empty.

mnpdf

Input dim cannot be empty.

moment

If order is nonintegral and X is real, use moment(complex(X), order).

nancov

If the input is variable-size and is [] at run time, returns [] not NaN.

nanmax

nanmean

nanmedian

nanmin

nanstd

nansum

nanvar

nbincdf

nbininv

nbinpdf

nbinrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

nbinstat

ncfcdf

ncfinv

ncfpdf

ncfrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

ncfstat

nctcdf

nctinv

nctpdf

nctrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

nctstat

ncx2cdf

ncx2rnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

ncx2stat

normcdf

norminv

normpdf

normrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

normstat

pca

  • Ignores the 'Display' value for 'Options' when 'Algorithm' is 'als'.

  • If supplied, 'Weights' and 'VariableWeights' must be real.

  • Always returns the fifth output explained as a column vector.

  • Always returns the sixth output mu as a row vector.

  • If mu is empty, pca returns mu as a 1-by-0 array. pca does not convert mu to a 0-by-0 empty array.

  • Does not treat an input matrix X that has all NaN values as a special case. The outputs have the sizes that they have when some of the inputs are finite.

pdf

pearsrnd

Matches MATLAB only when generated output r is scalar.

poisscdf

poissinv

poisspdf

poissrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

poisstat

prctile

  • Automatic dimension restriction

  • If the output Y is a vector, the orientation of Y differs from MATLAB when all of the following are true:

    • You do not supply the dim input.

    • X is a variable-size array.

    • X is not a variable-length vector.

    • X is a vector at run time.

    • The orientation of the vector X does not match the orientation of the vector p.

    In this case, the output Y matches the orientation of X not the orientation of p.

quantile

randg

random

randsample

When sampling without replacement, the order of the output values might not match MATLAB.

raylcdf

raylinv

raylpdf

raylrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

raylstat

skewness

tcdf

tinv

tpdf

trnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

tstat

unidcdf

unidinv

unidpdf

unidrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

unidstat

unifcdf

unifinv

unifpdf

unifrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

unifstat

wblcdf

wblinv

wblpdf

wblrnd

Can return a different sequence of numbers than MATLAB if either of the following is true:

  • The output is nonscalar.

  • An input parameter is invalid for the distribution.

wblstat

zscore

String Functions in MATLAB

Function

Remarks and Limitations

bin2dec

  • Does not support cell arrays.

  • Does not match MATLAB when the input is empty.

blanks

char

Does not support cell arrays.

deblank

  • Supports only inputs from the char class. Does not support cell arrays.

  • Input values must be in the range 0-127.

dec2bin

  • If input d is double, d must be less than 2^52.

  • If input d is single, d must be less than 2^23.

  • Unless you specify input n to be constant and n is large enough that the output has a fixed number of columns regardless of the input values, this function requires variable-sizing support. Without variable-sizing support, n must be at least 52 for double, 23 for single, 16 for char, 32 for int32, 16 for int16, and so on.

dec2hex

  • If input d is double, d must be less than 2^52.

  • If input d is single, d must be less than 2^23.

  • Unless you specify input n to be constant, and n is large enough that the output has a fixed number of columns regardless of the input values, this function requires variable-sizing support. Without variable-sizing support, n must be at least 13 for double, 6 for single, 4 for char, 8 for int32, 4 for int16, and so on.

hex2dec

Does not support cell arrays.

hex2num

  • Does not support cell arrays.

  • For n = hex2num(S), size(S,2) <= length(num2hex(0))

iscellstr

ischar

isletter

  • Input values from the char class must be in the range 0-127.

isspace

  • Input values from the char class must be in the range 0–127.

isstrprop

  • Supports only inputs from char and integer classes.

  • Input values must be in the range 0-127.

lower

  • Supports only char inputs. Does not support cell arrays.

  • Input values must be in the range 0-127.

num2hex

str2double

  • Does not support cell arrays.

  • Always returns a complex result.

strcmp

  • Does not support enumeration inputs.

  • When one input is a cell array and the other input is a character array, the character array must be a compile-time row vector.

  • When both inputs are empty character arrays that have different sizes, returns true.

strcmpi
  • Does not support enumeration inputs.

  • Input values from the char class must be in the range 0-127.

  • When one input is a cell array and the other input is a character array, the character array must be a compile-time row vector.

  • When both inputs are empty character arrays that have different sizes, returns true.

strfind
  • Does not support cell arrays.

  • If pattern does not exist in str, returns zeros(1,0) not []. To check for an empty return, use isempty.

  • Inputs must be character row vectors.

strjoin

Always returns a string that has size 1-by-n. For empty inputs, returns a 1-by-0 string not [].

strjust

Does not support a cell array of strings for the first argument.

strncmp

  • Does not support enumeration inputs.

  • When one input is a cell array and the other input is a character array, the character array must be a compile-time row vector.

strncmpi

  • Does not support enumeration inputs.

  • Input values from the char class must be in the range 0-127.

  • When one input is a cell array and the other input is a character array, the character array must be a compile-time row vector.

strrep

  • Does not support cell arrays.

  • If oldSubstr does not exist in origStr, returns blanks(0). To check for an empty return, use isempty.

  • Inputs must be character row vectors.

strtok

Does not support a cell arrays for the first argument.

strtrim

  • Supports only inputs from the char class. Does not support cell arrays.

  • Input values must be in the range 0-127.

upper

  • Supports only inputs from the char class. Does not support cell arrays.

  • Input values must be in the range 0-127.

System Identification Toolbox

C and C++ code generation for the following functions and System objects requires the System Identification Toolbox™ software.

Trigonometry in MATLAB

Function

Remarks and Limitations

acos

When the input value x is real, but the output should be complex, generates an error during simulation and returns NaN in generated code. To get the complex result, make the input value complex by passing in complex(x).

acosd

acosh

  • Generates an error during simulation and returns NaN in generated code when the input value x is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(x).

acot

acotd

acoth

acsc

acscd

acsch

asec

asecd

asech

asin

  • Generates an error during simulation and returns NaN in generated code when the input value x is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(x).

asind

asinh

atan

atan2

atan2d

atand

atanh

Generates an error during simulation and returns NaN in generated code when the input value x is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(x).

cos

cosd

cosh

cot

cotd

  • In some cases, returns -Inf when MATLAB returns Inf.

  • In some cases, returns Inf when MATLAB returns -Inf.

coth

csc

cscd

  • In some cases, returns -Inf when MATLAB returns Inf.

  • In some cases, returns Inf when MATLAB returns -Inf.

csch

deg2rad

hypot

rad2deg

sec

secd

  • In some cases, returns -Inf when MATLAB returns Inf.

  • In some cases, returns Inf when MATLAB returns -Inf.

sech

sin

sind

sinh

tan

tand

  • In some cases, returns -Inf when MATLAB returns Inf.

  • In some cases, returns Inf when MATLAB returns -Inf.

tanh

WLAN System Toolbox

C and C++ code generation for the following functions and System objects requires the WLAN System Toolbox™ software.

NameRemarks and Limitations
WLAN Modeling

wlanHTConfig

wlanNonHTConfig

wlanRecoveryConfig

wlanVHTConfig

Signal Transmission

wlanHTData

Cannot be used in MATLAB Function block

wlanHTLTF

wlanHTSIG

wlanHTSTF

wlanLLTF

wlanLSIG

wlanLSTF

wlanNonHTData

Cannot be used in MATLAB Function block

wlanVHTData

Cannot be used in MATLAB Function block

wlanVHTLTF

wlanVHTSIGA

wlanVHTSIGB

wlanVHTSTF

wlanWaveformGenerator

Cannot be used in MATLAB Function block

Signal Reception

wlanCoarseCFOEstimate

wlanFieldIndices

wlanFineCFOEstimate

wlanHTDataRecover

Cannot be used in MATLAB Function block

wlanHTLTFChannelEstimate

wlanHTLTFDemodulate

wlanHTSIGRecover

wlanLLTFChannelEstimate

wlanLLTFDemodulate

wlanLSIGRecover

wlanNonHTDataRecover

Cannot be used in MATLAB Function block

wlanVHTDataRecover

Cannot be used in MATLAB Function block

wlanVHTLTFChannelEstimate

wlanVHTLTFDemodulate

wlanVHTSIGARecover

wlanVHTSIGBRecover

Propagation Channel

wlanTGacChannel

System Objects in MATLAB Code Generation

wlanTGnChannel

System Objects in MATLAB Code Generation

Was this topic helpful?