You can generate efficient C and C++ code for a subset of MATLAB^{®} builtin 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.
Note: For more information on code generation for fixedpoint algorithms, refer to Code Acceleration and Code Generation from MATLAB. 
C and C++ code generation for the following Aerospace Toolbox quaternion functions requires the Aerospace Blockset™ software.
Function  Remarks and Limitations 

—  
—  
—  
—  
—  
—  
— 
See Array vs. Matrix Operations for detailed descriptions of the following operator equivalent functions.
Function  Remarks and Limitations 

ctranspose  — 
 
—  
—  
—  
—  
If  
—  
 
—  
 
—  
Multiplication of pure imaginary numbers by nonfinite
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,  
—  
—  
— 
Function  Remarks and Limitations 

—  
—  
—  
—  
No integer overflow detection
for  
—  
—  
 
No integer overflow detection
for 
C and C++ code generation for the following functions and System objects requires the Communications System Toolbox™ software.
C and C++ code generation for the following functions and System objects requires the Computer Vision System Toolbox™ software.
Name  Remarks and Limitations 

Feature Detection, Extraction, and Matching  
BRISKPoints  Supports MATLAB Function block: No To index locations with this object, use the syntax: points.Location(idx,:) ,
for points object. See visionRecovertformCodeGeneration_kernel.mvisionRecovertformCodeGeneration_kernel.m,
which is used in the Introduction to Code Generation with Feature Matching and Registration example. 
cornerPoints  Supports MATLAB Function block: No To index locations with this object, use the syntax: points.Location(idx,:) ,
for points object. See visionRecovertformCodeGeneration_kernel.mvisionRecovertformCodeGeneration_kernel.m,
which is used in the Introduction to Code Generation with Feature Matching and Registration example. 
detectBRISKFeatures  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
detectFASTFeatures  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
detectHarrisFeatures  Compiletime constant input: 'FilterSize' Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
detectMinEigenFeatures  Compiletime constant input: 'FilterSize' Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
detectMSERFeatures  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. For code generation, the function outputs regions.PixelList as
an array. The region sizes are defined in regions.Lengths . 
detectSURFFeatures  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
extractFeatures  Generates platformdependent library: Yes for BRISK , FREAK ,
and SURF methods only.Compiletime constant input restrictions: 'Method' Supports MATLAB Function block: Yes for Block method only.Generated code for this function uses a precompiled platformspecific shared library. 
extractHOGFeatures  Supports MATLAB Function block: No 
matchFeatures  Generates platformdependent library: Yes for MATLAB host. Generates portable C code for nonhost target. Compiletime constant input: 'Method‘ and 'Metric' .Supports MATLAB Function block: Yes 
MSERRegions  Supports 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 platformspecific shared library. 
SURFPoints  Supports MATLAB Function block: No To index locations with this object, use the syntax: points.Location(idx,:) ,
for points object. See visionRecovertformCodeGeneration_kernel.mvisionRecovertformCodeGeneration_kernel.m,
which is used in the Introduction to Code Generation with Feature Matching and Registration example. 
vision.BoundaryTracer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.EdgeDetector  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Image Registration and Geometric Transformations  
estimateGeometricTransform  Supports MATLAB Function block: No 
vision.GeometricRotator  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.GeometricScaler  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.GeometricShearer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.GeometricTransformer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.GeometricTranslator  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Object Detection and Recognition  
ocr  Compiletime constant input: 'TextLayout' , 'Language' ,
and 'CharacterSet' .Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
ocrText  Supports MATLAB Function block: No 
vision.PeopleDetector  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation 
vision.CascadeObjectDetector  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation 
Tracking and Motion Estimation  
assignDetectionsToTracks  Supports MATLAB Function block: Yes 
opticalFlowHS  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
opticalFlowLKDoG  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
opticalFlowLK  Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
opticalFlow  Supports MATLAB Function block: Yes 
vision.BlockMatcher  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ForegroundDetector  Supports MATLAB Function block: No Generates platformdependent library: Yes for MATLAB host. Generates portable C code for nonhost target. Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation 
vision.HistogramBasedTracker  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.KalmanFilter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.PointTracker  Supports MATLAB Function block: No System Objects in MATLAB Code Generation 
vision.TemplateMatcher  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Camera Calibration and Stereo Vision  
bboxOverlapRatio  Supports MATLAB Function block: No 
disparity  Compiletime constant input restriction: 'Method' .Supports MATLAB Function block: No Generated code for this function uses a precompiled platformspecific shared library. 
cameraMatrix  Supports MATLAB Function block: No 
cameraParameters  Supports MATLAB Function block: No 
epipolarline  Supports MATLAB Function block: Yes 
estimateFundamentalMatrix  Compiletime constant input restriction: 'Method' , 'OutputClass' , 'DistanceType' ,
and 'ReportRuntimeError' .Supports MATLAB Function block: Yes 
estimateUncalibratedRectification  Supports MATLAB Function block: Yes Only accepts input points as Mby2 matrices for C code generation 
extrinsics  Supports MATLAB Function block: No 
isEpipoleInImage  Supports MATLAB Function block: Yes 
lineToBorderPoints  Supports MATLAB Function block: Yes 
reconstructScene  Supports MATLAB Function block: No 
rectifyStereoImages  Compiletime constant input restriction: 'interp' and 'OutputView' Supports MATLAB Function block: No 
selectStrongestBbox  Supports MATLAB Function block: No 
stereoParameters  Supports MATLAB Function block: No 
triangulate  Supports MATLAB Function block: No 
undistortImage  Compiletime constant input restriction: 'interp' and 'OutputView' Supports MATLAB Function block: No 
Statistics  
vision.Autocorrelator  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.BlobAnalysis  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Crosscorrelator  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Histogram  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.LocalMaximaFinder  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Maximum  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Mean  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Median  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Minimum  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.PSNR  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.StandardDeviation  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Variance  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Morphological Operations  
vision.ConnectedComponentLabeler  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalBottomHat  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalClose  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalDilate  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalErode  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalOpen  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MorphologicalTopHat  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Filters, Transforms, and Enhancements  
integralImage  Supports MATLAB Function block: Yes 
vision.Convolver  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ContrastAdjuster  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.DCT  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Deinterlacer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.EdgeDetector  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.FFT  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.HistogramEqualizer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.HoughLines  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.HoughTransform  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.IDCT  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.IFFT  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ImageFilter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MedianFilter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.Pyramid  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Video Loading, Saving, and Streaming  
vision.DeployableVideoPlayer  Supports MATLAB Function block: Yes Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation 
vision.VideoFileReader  Supports MATLAB Function block: Yes Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation Does not generate code for reading compressed images on the Mac. 
vision.VideoFileWriter  Supports MATLAB Function block: Yes Generated code for this function uses a precompiled platformspecific shared library. System Objects in MATLAB Code Generation 
Color Space Formatting and Conversions  
vision.Autothresholder  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ChromaResampler  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ColorSpaceConverter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.DemosaicInterpolator  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.GammaCorrector  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ImageComplementer  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ImageDataTypeConverter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ImagePadder  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Graphics  
insertMarker  Compiletime constant input: 'Shape' and 'Color' Supports MATLAB Function block: Yes 
insertShape  Compiletime constant input: 'Color' and 'SmoothEdges' Supports MATLAB Function block: Yes 
vision.AlphaBlender  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.MarkerInserter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.ShapeInserter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
vision.TextInserter  Supports MATLAB Function block: Yes System Objects in MATLAB Code Generation 
Function  Remarks and Limitations 

—  
—  
—  
—  
—  
Treated as a  
—  
 
— 
Function  Remarks and Limitations 

 
—  
—  
 
 
 
—  

Function  Remarks and Limitations  

—  
—  
—  
 
—  
—  
 

Function  Remarks and Limitations 

 
 

Function  Remarks and Limitations 

 
—  
 
—  
 

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.
Name  Remarks and Limitations 

Estimation  
Filters  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
 
 
 
 
dsp.LowpassFilter  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
 
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
 
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
 
 
 
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
—  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
Math Operations  
dsp.UpperTriangularSolver  
Quantizers  
Scopes  
This System object™ does not generate code. It is
automatically declared as an extrinsic variable
using the  
This System object does not generate code. It is
automatically declared as an extrinsic variable
using the  
Signal Management  
Signal Operations  
 
Sinks  
Sources  
 
Statistics  
 
Transforms  
Function  Remarks and Limitations 

 
For standalone code generation, excluded from the generated code. 
Function  Remarks and Limitations 

—  
—  
—  
—  
 
—  
—  
—  
—  
—  
—  
—  
—  

Function  Remarks and Limitations 

—  
—  
—  
—  
 
—  
— 
In addition to functionspecific limitations listed in the table,
the following general limitations apply to the use of FixedPoint 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.
The general limitations of C/C++ code generated from MATLAB apply. For more information, see MATLAB Language Features Supported for C/C++ Code Generation.
Function  Remarks/Limitations 

N/A  
N/A  
N/A  
 
N/A  
N/A  
N/A  
Not supported for slopebias scaled  
N/A  
N/A  
N/A  
N/A  
Not supported for slopebias
scaled  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
Generated code may not handle out of range shifting.  
Generated code may not handle out of range shifting.  
Generated code may not handle out of range shifting.  
Not supported for slopebias
scaled  
N/A  
N/A  
N/A  
N/A  
 
N/A  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
Variablesize signals are not supported.  
N/A  
N/A  
If supplied, the index, k,
must be a real and scalar integer value that is not a  
 
For the automated workflow, do not use explicit double or single casts in your MATLAB algorithm to insulate functions that do not support fixedpoint 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.  
N/A  
 
Not supported for fixedpoint signals with different biases.  
 
 
 
N/A  
N/A  
The dimensions argument
must be a builtin type; it cannot be a  
N/A  
N/A  
N/A  
N/A  
Not supported for fixedpoint signals with different biases.  
The syntax  
N/A  
N/A  
Not supported for fixedpoint signals with different biases.  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
Avoid using the  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
Not supported for fixedpoint signals with different biases.  
N/A  
N/A  
N/A  
 
Not supported for fixedpoint signals with different biases.  
N/A  
N/A  
N/A  
N/A  
Any
non  
 
 
N/A  
 
N/A  
Not supported for fixedpoint signals with different biases.  
N/A  
 
N/A  
 
The dimensions argument
must be a builtin type; it cannot be a  
Any
non  
N/A  
When the exponent  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
N/A  
The dimensions argument
must be a builtin type; it cannot be a  
N/A  
N/A  
In the syntax  
N/A  
N/A  
 
The dimensions argument
must be a builtin type; it cannot be a  
N/A  
N/A  
For the automated workflow, do not use explicit double or single casts in your MATLAB algorithm to insulate functions that do not support fixedpoint 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.  
N/A  
The dimensions argument
must be a builtin type; it cannot be a  
N/A  
 
N/A  
N/A  
 
N/A  
N/A  
Variablesized inputs
are only supported when the  
 
N/A  
If supplied, the index, k,
must be a real and scalar integer value that is not a  
If supplied, the index, k,
must be a real and scalar integer value that is not a  
 
N/A  
N/A  
N/A  
N/A  
N/A 
Function  Remarks and Limitations 

This System object is available with MATLAB. 
Function  Remarks and Limitations 

For the syntax
 

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.
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 platformspecific
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.
Function  Remarks/Limitations 

affine2d  When generating code, you can only specify single objects—arrays of objects are not supported. 
bwdist  The Generated code for this function uses a precompiled, platformspecific shared library. 
If you choose the generic MATLAB Host Computer target
platform, generated code uses a precompiled, platformspecific shared
library.  
When generating code, the parameter  
For best results, specify an input image of class If
you choose the generic  
The text string specifying the operation must be a constant
and, for best results, specify an input image of class If
you choose the generic  
bwpack  Generated code for this function uses a precompiled platformspecific shared library. 
Supports only 2D images. Does not support any
nooutputargument
syntaxes. The connectivity matrix input argument, If you choose the generic  
bwselect  Supports only the 3 and 4 input argument syntaxes: If
you choose the generic 
bwtraceboundary  The dir , fstep , and conn arguments
must be compiletime constants. 
bwunpack  Generated code for this function uses a precompiled platformspecific shared library. 
Input arguments must be compiletime constants.  
edge  The If
you choose the generic 
fitgeotrans  The transformtype argument must be a compiletime
constant. The function supports the following transformation types: 'nonreflectivesimilarity' , 'similarity' , 'affine' ,
or 'projective' . 
Inputs must be compiletime constants. Expressions or variables are allowed if their values do not change.  
getrangefromclass  — 
histeq  All the syntaxes that
include indexed images are not supported. This includes all
syntaxes that accept Generated code for this function uses a precompiled platformspecific shared library. 
im2uint8  If you choose the generic 
im2uint16  Generated code for this function uses a precompiled platformspecific shared library. 
im2int16  Generated code for this function uses a precompiled platformspecific shared library. 
im2single  — 
im2double  — 
imadjust  Does not support syntaxes that include indexed images.
This includes all syntaxes that accept Generated code for this function uses a precompiled platformspecific shared library. 
imbothat  The input image If you choose the generic 
imclearborder  The optional second input argument, If
you choose the generic 
imclose  The input image If you choose the generic 
Does not support  
imdilate  The input image If
you choose the generic 
imerode  The input image If
you choose the generic 
imextendedmax  The optional third input argument, If you choose the generic 
imextendedmin  The optional third input argument, If you choose the generic 
The optional input connectivity, Supports only up to 3D inputs. The interactive mode to select
points,
If you choose the generic  
imfilter  The input image can be either 2D or 3D. The value of
the input argument, If you choose the generic 
imhist  The optional second input argument, If you choose the generic 
The optional third input argument, If you choose the generic  
The optional third input argument, If you choose the generic  
imlincomb  The Generated code for this function uses a precompiled platformspecific shared library. 
imopen  The input image If you choose the generic 
imquantize  — 
The optional third input argument, If you choose the generic  
imref2d  The 
imref3d  The 
The optional second input argument, If you choose the generic  
The optional second input argument, If you choose the generic  
imtophat  The input image If you choose the generic 
imwarp  The geometric transformation object input, If you choose the generic 
intlut  Generated code for this function uses a precompiled platformspecific shared library. 
Input arguments must be compiletime constants.  
iptcheckmap  — 
Referring to the standard syntax: RGB = label2rgb(L, map, zerocolor, order)
 
mean2  — 
medfilt2  The If you choose the generic 
multithresh  If you choose the generic 
ordfilt2  The If you choose the generic 
padarray  Support only up to 3D inputs. Input arguments, 
projective2d  When generating code, you can only specify single objects—arrays of objects are not supported. 
Supports only 2D images. Does not accept the connected
component structure (CC) returned by If you choose the
generic  
rgb2gray  — 
rgb2ycbcr  — 
strel  Input arguments must be compiletime constants. The following
methods are not supported for code generation: getsequence , reflect , translate , disp , display , loadobj .
When generating code, you can only specify single objects—arrays
of objects are not supported. 
stretchlim  If you choose the generic 
Supports only 2D images. Supports only 4 or 8connectivity.
Supports only up to 65,535 regions. The output type is always If
you choose the generic  
ycbcr2rgb  — 
Function  Remarks and Limitations 

—  
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
Might not match MATLAB when some  
 
 
—  
 
 
—  
—  
The size of output
The code generation software does not remove the singleton dimensions. However, MATLAB might remove singleton dimensions. For
example, suppose that  
—  
—  
 

Function  Remarks and Limitations 

—  
—  
—  
—  
—  
—  
—  
 
 
 
 
—  
Can return a different Schur decomposition in generated code than in MATLAB.  
— 
C and C++ code generation for the following functions requires the MATLAB Compiler™ software.
Function  Remarks and Limitations 

 

Function  Remarks and Limitations  

—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
—  
bsxfun  VariableSizing Restrictions for Code Generation of Toolbox Functions  
cat 
 
—  
 
compan  —  
cond  VariableSizing Restrictions for Code Generation of Toolbox Functions  
cov 
 
 
Does not support logical inputs. Cast input to  
Does not support logical inputs. Cast input to  
—  
 
 
—  
 
 
 
 
—  
 
—  
—  
—  
—  
—  
—  
 
Singular matrix inputs can produce nonfinite values that differ from MATLAB results.  
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions.  
 
 
—  
—  
—  
—  
—  
—  
—  
 
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
—  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
 
—  
 
 
 
—  
—  
—  
—  
 
—  
—  
 
—  
—  
If the input is a complex type,  
If the input is a complex type,  
—  
 
—  
 
—  
—  
 
 
 
—  
—  

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.
Function  Remarks and Limitations 

—  
—  
 
—  
 
 
The  
All inputs must be constant.  

Function  Remarks and Limitations 

 
 
Input parameter names must be constant.  

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

Antenna and Microphone Elements  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.CosineAntennaElement 

phased.CrossedDipoleAntennaElement 

phased.CustomAntennaElement 

phased.CustomMicrophoneElement 

phased.IsotropicAntennaElement 

phased.OmnidirectionalMicrophoneElement 

phased.ShortDipoleAntennaElement 

Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
 
 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Array Geometries and Analysis  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.ArrayGain 

phased.ArrayResponse  See System Objects in MATLAB Code Generation. 
phased.ConformalArray 

phased.ElementDelay  See System Objects in MATLAB Code Generation. 
phased.PartitionedArray 

phased.ReplicatedSubarray 

phased.SteeringVector  See System Objects in MATLAB Code Generation. 
phased.UCA 

phased.ULA 

phased.URA 

Signal Radiation and Collection  
phased.Collector  See System Objects in MATLAB Code Generation. 
phased.Radiator  See System Objects in MATLAB Code Generation. 
phased.WidebandCollector 

Does not support variablesize inputs.  
Waveforms  
Does not support variablesize inputs.  
phased.FMCWWaveform 

phased.LinearFMWaveform 

phased.MFSKWaveform 

phased.PhaseCodedWaveform 

phased.RectangularWaveform 

phased.SteppedFMWaveform 

Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Transmitters and Receivers  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.ReceiverPreamp  See System Objects in MATLAB Code Generation. 
phased.Transmitter  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Beamforming  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.FrostBeamformer 

phased.LCMVBeamformer  See System Objects in MATLAB Code Generation. 
phased.MVDRBeamformer  See System Objects in MATLAB Code Generation. 
phased.PhaseShiftBeamformer  See System Objects in MATLAB Code Generation. 
phased.SteeringVector  See System Objects in MATLAB Code Generation. 
phased.SubbandPhaseShiftBeamformer  See System Objects in MATLAB Code Generation. 
phased.TimeDelayBeamformer 

phased.TimeDelayLCMVBeamformer 

Does not support variablesize inputs.  
Does not support variablesize inputs.  
Direction of Arrival (DOA) Estimation  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.BeamscanEstimator  See System Objects in MATLAB Code Generation. 
phased.BeamscanEstimator2D  See System Objects in MATLAB Code Generation. 
phased.BeamspaceESPRITEstimator  See System Objects in MATLAB Code Generation. 
phased.ESPRITEstimator  See System Objects in MATLAB Code Generation. 
phased.MVDREstimator  See System Objects in MATLAB Code Generation. 
phased.MVDREstimator2D  See System Objects in MATLAB Code Generation. 
phased.RootMUSICEstimator  See System Objects in MATLAB Code Generation. 
phased.RootWSFEstimator  See System Objects in MATLAB Code Generation. 
phased.SumDifferenceMonopulseTracker  See System Objects in MATLAB Code Generation. 
phased.SumDifferenceMonopulseTracker2D  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
SpaceTime Adaptive Processing (STAP)  
Does not support variablesize inputs.  
phased.ADPCACanceller  See System Objects in MATLAB Code Generation. 
phased.AngleDopplerResponse  See System Objects in MATLAB Code Generation. 
phased.DPCACanceller  See System Objects in MATLAB Code Generation. 
phased.STAPSMIBeamformer  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Signal Propagation and Environment  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.BarrageJammer  See System Objects in MATLAB Code Generation. 
phased.ConstantGammaClutter  See System Objects in MATLAB Code Generation. 
phased.FreeSpace 

phased.RadarTarget  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Detection and System Analysis  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.CFARDetector  See System Objects in MATLAB Code Generation. 
phased.MatchedFilter 

phased.RangeDopplerResponse 

phased.StretchProcessor  See System Objects in MATLAB Code Generation. 
phased.TimeVaryingGain  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
 
 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Motion Modeling and Coordinate Systems  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
phased.Platform  See System Objects in MATLAB Code Generation. 
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs.  
Does not support variablesize inputs. 
Function  Remarks and Limitations 

 
The output can contain fewer  
VariableSizing Restrictions for Code Generation of Toolbox Functions  
—  
—  
—  

Function  Remarks and Limitations 

—  
—  
—  
 
 
Supports only the syntax 
Function  Remarks and Limitations 

 
 
 
 
 

Function  Remarks and Limitations 

—  
—  
 
 
 
—  
 
—  
 
 
 
—  
Uses a different  
— 
C and C++ code generation for the following functions requires the Signal Processing Toolbox™ software. These functions do not support variablesize 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 
Function  Remarks/Limitations 

Window length must be a constant. Expressions or variables are allowed if their values do not change.  
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. 
—  
Window length must be a constant. Expressions or variables are allowed if their values do not change.  
Window length must be a constant. Expressions or variables are allowed if their values do not change.  
Window length must be a constant. Expressions or variables are allowed if their values do not change.  
Filter order must be a constant. Expressions or variables are allowed if their values do not change.  
Filter coefficients must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All Inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
—  
C and C++ code generation for 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.  
—  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
Inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
Filter coefficients must be constants. Expressions or variables are allowed if their values do not change.  
—  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constants. Expressions or variables are allowed if their values do not change.  
When called with no
output arguments, and without a semicolon at the end, If the semicolon is added, the function produces a plot of the magnitude and phase response of the filter.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
C and C++ code generation for 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.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
—  
C and C++ code generation for If specified, the order of recursion must be a constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
—  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
The upsampling and downsampling factors must be specified as constants. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
—  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
All inputs must be constant. Expressions or variables are allowed if their values do not change.  
C and C++ code generation for Filter coefficients, upsampling factor, and downsampling factor must be constants. Expressions or variables are allowed if their values do not change. Variablesize inputs are not supported.  
Either declare input assert(n<10)  
—  
If specified, the order of recursion must be a constant. Expressions or variables are allowed if their values do not change. 
Function  Remarks and Limitations 

 
 
—  
—  
NaN or 

—  
—  
— 
Function  Remarks and Limitations 

 
—  
—  
 
 
 
 

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

—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
Input  
Input  
If  
If the input is variablesize and is  
—  
—  
—  
—  
—  
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
 
—  
Matches MATLAB only when generated output  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
 
—  
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
—  
—  
—  
Can return a different sequence of numbers than MATLAB if either of the following is true:
 
—  
— 
Function  Remarks and Limitations 

 
—  
—  
 
 
 
—  
 
—  
 
 
 
 
—  
 
—  
strcmpi  Input values from the 
strfind 

strjust  — 
—  
 
 
—  
 

Function  Remarks and Limitations 

 
—  
 
—  
—  
—  
—  
—  
—  
—  
—  
—  
 
—  
—  
—  
—  
—  
—  
Generates
an error during simulation and returns  
—  
—  
—  
—  
 
—  
—  
 
—  
—  
—  
 
—  
—  
—  
—  
—  
 
— 