Accelerating the pace of engineering and science

# Documentation Center

• 평가판
• 제품 업데이트

## Functions Supported for C/C++ Code Generation — Categorical List

### Aerospace Toolbox Functions

Function

Description

quatconj

Calculate conjugate of quaternion

quatdivide

Divide quaternion by another quaternion

quatinv

Calculate inverse of quaternion

quatmod

Calculate modulus of quaternion

quatmultiply

Calculate product of two quaternions

quatnorm

Calculate norm of quaternion

quatnormalize

Normalize quaternion

### Arithmetic Operator Functions

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

Function

Description

ctranspose

Complex conjugate transpose (')

idivide

Integer division with rounding option

isa

Determine if input is object of given class

ldivide

Left array divide

minus

Minus (-)

mldivide

Left matrix divide (\)

mpower

Equivalent of array power operator (.^)

mrdivide

Right matrix divide

mtimes

Matrix multiply (*)

plus

Plus (+)

power

Array power

rdivide

Right array divide

times

Array multiply

transpose

Matrix transpose (')

uminus

Unary minus (-)

uplus

Unary plus (+)

### Bit-Wise Operation Functions

Function

Description

flintmax

Largest consecutive integer in floating-point format

swapbytes

Swap byte ordering

### Casting Functions

Data Type

Description

cast

Cast variable to different data type

char

Create character array (string)

class

Query class of object argument

double

Convert to double-precision floating point

Convert to signed integer data type

logical

Convert to Boolean true or false data type

single

Convert to single-precision floating point

typecast

Convert data types without changing underlying data

Convert to unsigned integer data type

### Communications System Toolbox Functions

Function Remarks/Limitations

bi2de

de2bi

istrellis

poly2trellis

### Complex Number Functions

Function

Description

complex

Construct complex data from real and imaginary components

conj

Return the conjugate of a complex number

imag

Return the imaginary part of a complex number

isnumeric

Return true for numeric arrays

isreal

Return false (0) for a complex number

isscalar

Return true if array is a scalar

real

Return the real part of a complex number

unwrap

Correct phase angles to produce smoother phase plots

### Computer Vision System Toolbox Functions

FunctionDescription

binaryFeatures

Object for storing binary feature vectors

cornerPoints

Object for storing corner points

detectFASTFeatures

Find corners using FAST algorithm

detectMSERFeatures

Detect MSER features

detectSURFFeatures

Detect SURF features

disparity

Disparity map between stereo images

epipolarLine

Compute epipolar lines for stereo images

estimateFundamentalMatrix

Estimate fundamental matrix from corresponding points in stereo image

estimateUncalibratedRectification

Uncalibrated stereo rectification

extractFeatures

Extract interest point descriptors

insertMarker

Insert markers in image or video

insertShape

Insert shapes in image or video

integralImage

Compute integral image

isEpipoleInImage

Determine whether image contains epipole

lineToBorderPoints

Intersection points of lines in image and image border

matchFeatures

Find matching image features

MSERRegions

Object for storing MSER regions

SURFPoints

Object for storing SURF interest points

vision.KalmanFilter

Kalman filter for object tracking

### Data and File Management Functions

Function

Description

computer

Information about computer on which MATLAB® software is running

fclose

Close one or all open files

fopen

Open file, or obtain information about open files

fprintf

Write data to text file

Load data from MAT-file into workspace

### Data Type Functions

Function

Description

deal

Distribute inputs to outputs

iscell

Determine whether input is cell array

nargchk

Validate number of input arguments

 Note:   nargchk will be removed in a future release.

narginchk

Validate number of input arguments

nargoutchk

Validate number of output arguments

str2func

Construct function handle from function name string

structfun

Apply function to each field of scalar structure

### Derivative and Integral Functions

Function

Description

cumtrapz

Cumulative trapezoidal numerical integration

del2

Discrete Laplacian

diff

Differences and approximate derivatives

trapz

Trapezoidal numerical integration

### Discrete Math Functions

Function

Description

factor

Return a row vector containing the prime factors of n

gcd

Return an array containing the greatest common divisors of the corresponding elements of integer arrays

isprime

Array elements that are prime numbers

lcm

Least common multiple of corresponding elements in arrays

nchoosek

Binomial coefficient or all combinations

primes

Generate list of prime numbers

### Error Handling Functions

Function

Description

assert

Generate error when condition is violated

error

Display message and abort function

### Exponential Functions

Function

Description

Exponential

expm

Matrix exponential

expm1

Compute exp(x)-1 accurately for small values of x

factorial

Factorial function

log

Natural logarithm

log2

Base 2 logarithm and dissect floating-point numbers into exponent and mantissa

log10

Common (base 10) logarithm

log1p

Compute log(1+x) accurately for small values of x

nextpow2

Next higher power of 2

nthroot

Real nth root of real numbers

reallog

Natural logarithm for nonnegative real arrays

realpow

Array power for real-only output

realsqrt

Square root for nonnegative real arrays

sqrt

Square root

### Filtering and Convolution Functions

Function

Description

Convolution and polynomial multiplication

conv2

2-D convolution

convn

N-D convolution

deconv

Deconvolution and polynomial division

detrend

Remove linear trends

filter

1-D digital filter

filter2

2-D digital filter

### Fixed-Point Designer Functions

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 or 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.

FunctionRemarks/Limitations

abs

N/A

accumneg

N/A

accumpos

N/A

N/A

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.

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

N/A

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.

• 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.

fix

N/A

fixed.Quantizer

N/A

floor

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.

hdlram

N/A

horzcat

N/A

imag

You cannot use int64 in a MATLAB Function block in a Simulink model or in a MATLAB function in a Stateflow® chart.

iscolumn

N/A

isempty

N/A

isequal

N/A

isfi

N/A

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

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.

permute

N/A

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.

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

N/A

rescale

N/A

reshape

N/A

round

N/A

setfimath

N/A

sfi

N/A

sign

N/A

sin

N/A

single

N/A

size

N/A

sort

N/A

sqrt

• Complex and [Slope Bias] inputs error out.

• Negative inputs yield a 0 result.

storedInteger

N/A

storedIntegerToDouble

N/A

sub

N/A

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

N/A

You cannot use uint64 in a MATLAB Function block in a Simulink model or in a MATLAB function in a Stateflow chart.

uminus

N/A

uplus

N/A

upperbound

N/A

vertcat

N/A

### Histogram Functions

Function

Description

hist

Non-graphical histogram

histc

Histogram count

### Image Processing Toolbox Functions

You must have the MATLAB Coder™ software installed to generate C/C++ code from MATLAB for these functions.

FunctionRemarks/Limitations

bwlookup

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

bwmorph

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

conndef

All input arguments must be compile-time constants.

fspecial

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

imcomplement

Does not support int64 and uint64 data types.

imfill

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

Supports only up to 3-D inputs. (No N-D support.)

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.

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

imhmax

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

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

imhmin

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

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

imreconstruct

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

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

imregionalmax

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

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

imregionalmin

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

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

iptcheckconn

All input arguments must be compile-time constants.

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'.

Support only up to 3-D inputs.

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

### Input and Output Functions

Function

Description

nargin

Return the number of input arguments a user has supplied

nargout

Return the number of output return values a user has requested

### Interpolation and Computational Geometry Functions

Function

Description

cart2pol

Transform Cartesian coordinates to polar or cylindrical

cart2sph

Transform Cartesian coordinates to spherical

interp1

1-D data interpolation (table lookup)

interp2

2-D data interpolation (table lookup)

meshgrid

Generate X and Y arrays for 3-D plots

pol2cart

Transform polar or cylindrical coordinates to Cartesian

sph2cart

Transform spherical coordinates to Cartesian

### Linear Algebra

FunctionDescription

linsolve

Solve linear system of equations

null

Null space

orth

Range space of matrix

rsf2csf

Convert real Schur form to complex Schur form

schur

Schur decomposition

sqrtm

Matrix square root

### Logical Operator Functions

FunctionDescription

and

Logical AND (&&)

bitand

Bitwise AND

bitcmp

Bitwise complement

bitget

Bit at specified position

bitor

Bitwise OR

bitset

Set bit at specified position

bitshift

Shift bits specified number of places

bitxor

Bitwise XOR

not

Logical NOT (~)

or

Logical OR (||)

xor

Logical exclusive-OR

### MATLAB Compiler Functions

Function

Description

isdeployed

Determine whether code is running in deployed or MATLAB mode

ismcc

Test if code is running during compilation process (using mcc)

### MATLAB Desktop Environment Functions

Function

Description

ismac

Determine if version is for Mac OS X platform

ispc

Determine if version is for Windows® (PC) platform

isunix

Determine if version is for UNIX® platform

### Matrix and Array Functions

Function

Description

abs

Return absolute value and complex magnitude of an array

all

Test if all elements are nonzero

angle

Phase angle

any

Test for any nonzero elements

blkdiag

Construct block diagonal matrix from input arguments

bsxfunApplies element-by-element binary operation to two arrays with singleton expansion enabled
cat

Concatenate arrays along specified dimension

circshift

Shift array circularly

compan

Companion matrix

cond

Condition number of a matrix with respect to inversion

cov

Covariance matrix

cross

Vector cross product

cumprod

Cumulative product of array elements

cumsum

Cumulative sum of array elements

det

Matrix determinant

diag

Return a matrix formed around the specified diagonal vector and the specified diagonal (0, 1, 2,...) it occupies

diff

Differences and approximate derivatives

dot

Vector dot product

eig

Eigenvalues and eigenvectors

eye

Identity matrix

false

Return an array of 0s for the specified dimensions

find

Find indices and values of nonzero elements

flipdim

Flip array along specified dimension

fliplr

Flip matrix left to right

flipud

Flip matrix up to down

full

Convert sparse matrix to full matrix

hankel

Hankel matrix

hilb

Hilbert matrix

ind2sub

Subscripts from linear index

inv

Inverse of a square matrix

invhilb

Inverse of Hilbert matrix

ipermute

Inverse permute dimensions of array

iscolumn

True if input is a column vector

isempty

Determine whether array is empty

isequal

Test arrays for equality

isequaln

Test arrays for equality, treating NaNs as equal

isfinite

Detect finite elements of an array

isfloat

Determine if input is floating-point array

isinf

Detect infinite elements of an array

isinteger

Determine if input is integer array

islogical

Determine if input is logical array

ismatrix

True if input is a matrix

isnan

Detect NaN elements of an array

isrow

True if input is a row vector

issparse

Determine whether input is sparse

isvector

Determine whether input is vector

kron

Kronecker tensor product

length

Return the length of a matrix

linspace

Generate linearly spaced vectors

logspace

Generate logarithmically spaced vectors

lu

Matrix factorization

magic

Magic square

max

Maximum elements of a matrix

min

Minimum elements of a matrix

ndgrid

Generate arrays for N-D functions and interpolation

ndims

Number of dimensions

nnz

Number of nonzero matrix elements

nonzeros

Nonzero matrix elements

norm

Vector and matrix norms

normest

2-norm estimate

numel

Number of elements in array or subscripted array

ones

Create a matrix of all 1s

pascal

Pascal matrix

permute

Rearrange dimensions of array

pinv

Pseudoinverse of a matrix

planerot

Givens plane rotation

prod

Product of array element

qr

Orthogonal-triangular decomposition

rand

Uniformly distributed pseudorandom numbers

randi

Uniformly distributed pseudorandom integers

randn

Normally distributed random numbers

randperm

Random permutation

rank

Rank of matrix

rcond

Matrix reciprocal condition number estimate

repmat

Replicate and tile an array

reshape

Reshape one array into the dimensions of another

rng

Control random number generation

rosser

Classic symmetric eigenvalue test problem

rot90

Rotate matrix 90 degrees

shiftdim

Shift dimensions

sign

Signum function

size

Return the size of a matrix

sort

Sort elements in ascending or descending order

sortrows

Sort rows in ascending order

squeeze

Remove singleton dimensions

sub2ind

Single index from subscripts

subspace

Angle between two subspaces

sum

Sum of matrix elements

toeplitz

Toeplitz matrix

trace

Sum of diagonal elements

tril

Extract lower triangular part

triu

Extract upper triangular part

true

Return an array of logical (Boolean) 1s for the specified dimensions

vander

Vandermonde matrix

wilkinson

Wilkinson's eigenvalue test matrix

zeros

Create a matrix of all zeros

### Nonlinear Numerical Methods

Function

Description

fzero

Find root of continuous function of one variable

Numerically evaluate double integral over planar region

### Phased Array System Toolbox Functions

Function Description

aictest

Dimension of signal subspace

albersheim

Required SNR using Albersheim's equation

ambgfun

Ambiguity function

aperture2gain

Convert effective aperture to gain

Convert azimuth angle to broadside angle

azel2phitheta

Convert angles from azimuth/elevation form to phi/theta form

azel2phithetapat

Convert radiation pattern from azimuth/elevation to phi/theta form

azel2uv

Convert azimuth/elevation angles to u/v coordinates

azel2uvpat

Convert radiation pattern from azimuth/elevation form to u/v form

azelaxes

Spherical basis vectors in 3-by-3 matrix form

beat2range

Convert beat frequency to range

billingsleyicm

Billingsley's intrinsic clutter motion (ICM) model

Convert broadside angle to azimuth angle

cart2sphvec

Convert vector from Cartesian components to spherical representation

cbfweights

Conventional beamformer weights

circpol2pol

Convert circular component representation of field to linear component representation

dechirp

Perform dechirp operation on FMCW signal

delayseq

depressionang

Depression angle of surface target

dop2speed

Convert Doppler shift to speed

dopsteeringvec

Doppler steering vector

espritdoa

Direction of arrival using TLS ESPRIT

fspl

Free space path loss

gain2aperture

Convert gain to effective aperture

global2localcoord

Convert global to local coordinates

grazingang

Grazing angle of surface target

horizonrange

Horizon range

lcmvweights

Narrowband linearly constrained minimum variance (LCMV) beamformer weights

local2globalcoord

Convert local to global coordinates

mdltest

Dimension of signal subspace

mvdrweights

Minimum variance distortionless response (MVDR) beamformer weights

noisepow

npwgnthresh

Detection SNR threshold for signal in white Gaussian noise

phitheta2azel

Convert angles from phi/theta form to azimuth/elevation form

phitheta2azelpat

Convert radiation pattern from phi/theta form to azimuth/elevation form

phitheta2uv

Convert phi/theta angles to u/v coordinates

phitheta2uvpat

Convert radiation pattern from phi/theta form to u/v form

physconst

Physical constants

pol2circpol

Convert linear component representation of field to circular component representation

polellip

Parameters of ellipse traced out by tip of a polarized field vector

polloss

Polarization loss

polratio

Ratio of vertical to horizontal linear polarization components of a field

polsignature

Copolarization and cross-polarization signatures

pulsint

Pulse integration

Peak power estimate from radar equation

Maximum theoretical range estimate

Vertical coverage diagram

range2beat

Convert range to beat frequency

range2bw

Convert range resolution to required bandwidth

range2time

Convert propagation distance to propagation time

rangeangle

Range and angle calculation

rdcoupling

Range Doppler coupling

rocpfa

Receiver operating characteristic curves by false-alarm probability

rocsnr

Receiver operating characteristic curves by SNR

rootmusicdoa

Direction of arrival using Root MUSIC

rotx

Rotation matrix for rotations around x-axis

roty

Rotation matrix for rotations around y-axis

rotz

Rotation matrix for rotations around z-axis

sensorcov

Sensor spatial covariance matrix

sensorsig

Simulate received signal at sensor array

shnidman

Required SNR using Shnidman's equation

speed2dop

Convert speed to Doppler shift

sph2cartvec

Convert vector from spherical basis components to Cartesian components

spsmooth

Spatial smoothing

steervec

Steering vector

stokes

Stokes parameters of polarized field

stretchfreq2rng

Convert frequency offset to range

surfacegamma

Gamma value for different terrains

surfclutterrcs

Surface clutter radar cross section (RCS)

systemp

time2range

Convert propagation time to propagation distance

unigrid

Uniform grid

uv2azel

Convert u/v coordinates to azimuth/elevation angles

uv2azelpat

Convert radiation pattern from u/v form to azimuth/elevation form

uv2phitheta

Convert u/v coordinates to phi/theta angles

uv2phithetapat

Convert radiation pattern from u/v form to phi/theta form

val2ind

Uniform grid index

### Polynomial Functions

Function

Description

poly

Polynomial with specified roots

polyfit

Polynomial curve fitting

polyval

Polynomial evaluation

roots

Polynomial roots

### Programming Utilities

Function

Description

mfilename

File name of currently running function

### Relational Operator Functions

Function

Description

eq

Equal (==)

ge

Greater than or equal to (>=)

gt

Greater than (>)

le

Less than or equal to (<=)

lt

Less than (<)

ne

Not equal (~=)

### Rounding and Remainder Functions

Function

Description

ceil

Round toward plus infinity

ceil

Round toward positive infinity

convergent

Round toward nearest integer with ties rounding to nearest even integer

fix

Round toward zero

fix

Round toward zero

floor

Round toward minus infinity

floor

Round toward negative infinity

mod

Modulus (signed remainder after division)

nearest

Round toward nearest integer with ties rounding toward positive infinity

rem

Remainder after division

round

Round toward nearest integer

round

Round fi object toward nearest integer or round input data using quantizer object

### Set Functions

Function

Description

intersect

Set intersection of two arrays

ismember

Array elements that are members of set array

issorted

Determine whether set elements are in sorted order

setdiff

Set difference of two arrays

setxor

Set exclusive OR of two arrays

union

Set union of two arrays

unique

Unique values in array

### Signal Processing Functions in MATLAB

FunctionDescription

chol

Cholesky factorization

conv

Convolution and polynomial multiplication

fft

Discrete Fourier transform

fft2

2-D discrete Fourier transform

fftn

N-D discrete Fourier transform

fftshift

Shift zero-frequency component to center of spectrum

filter

Filter a data sequence using a digital filter that works for both real and complex inputs

freqspace

Frequency spacing for frequency response

ifft

Inverse discrete Fourier transform

ifft2

2-D inverse discrete Fourier transform

ifftn

N-D inverse discrete Fourier transform

ifftshift

Inverse discrete Fourier transform shift

svd

Singular value decomposition

zp2tf

Convert zero-pole-gain filter parameters to transfer function form

### Signal Processing Toolbox Functions

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.

dct

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.

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.

firrcos

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

freqz with no output arguments produces a plot only when the function call terminates in a semicolon. See freqz With No Output Arguments.

gaussfir

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

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

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

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.

rectwin

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

resample

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

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

• 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

yulewalk

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

### Special Values

Symbol

Description

eps

Floating-point relative accuracy

inf

IEEE® arithmetic representation for positive infinity

intmax

Largest possible value of specified integer type

intmin

Smallest possible value of specified integer type

NaN or nan

Not a number

pi

Ratio of the circumference to the diameter for a circle

realmax

Largest positive floating-point number

realmin

Smallest positive floating-point number

### Specialized Math

Symbol

Description

beta

Beta function

betainc

Incomplete beta function

betaincinv

Beta inverse cumulative distribution function

betaln

Logarithm of beta function

ellipke

Complete elliptic integrals of first and second kind

erf

Error function

erfc

Complementary error function

erfcinv

Inverse of complementary error function

erfcx

Scaled complementary error function

erfinv

Inverse error function

expint

Exponential integral

gamma

Gamma function

gammainc

Incomplete gamma function

gammaincinv

Inverse incomplete gamma function

gammaln

Logarithm of the gamma function

psi

Psi (polygamma) function

### Statistical Functions

Function

Description

corrcoef

Correlation coefficients

mean

Average or mean value of array

median

Median value of array

mode

Most frequent values in array

std

Standard deviation

var

Variance

### Statistics Toolbox Functions

Function

Description

betacdf

Beta cumulative distributive function

betainv

Beta inverse cumulative distribution function

betapdf

Beta probability density function

betarnd

Beta random numbers

betastat

Beta mean and variance

binocdf

Binomial cumulative distribution function

binoinv

Binomial inverse cumulative distribution function

binopdf

Binomial probability density function

binornd

Binomial random numbers

binostat

Binomial mean and variance

cdf

Cumulative distribution function of probability distribution object

chi2cdf

Chi-square cumulative distribution function

chi2inv

Chi-square inverse cumulative distribution function

chi2pdf

Chi-square probability density function

chi2rnd

Chi-square random numbers

chi2stat

Chi-square mean and variance

evcdf

Extreme value cumulative distribution function

evinv

Extreme value inverse cumulative distribution

evpdf

Extreme value probability density function

evrnd

Extreme value random numbers

evstat

Extreme value mean and variance

expcdf

Exponential cumulative distribution function

expinv

Exponential inverse cumulative distribution function

exppdf

Exponential probability density function

exprnd

Exponential random numbers

expstat

Exponential mean and variance

fcdf

F cumulative distribution function

finv

F inverse cumulative distribution function

fpdf

F probability density function

frnd

F random numbers

fstat

F mean and variance

gamcdf

Gamma cumulative distribution function

gaminv

Gamma inverse cumulative distribution function

gampdf

Gamma probability density function

gamrnd

Gamma random numbers

gamstat

Gamma mean and variance

geocdf

Geometric cumulative distribution function

geoinv

Geometric inverse cumulative distribution function

geomean

Geometric mean

geopdf

Geometric probability density function

geornd

Geometric random numbers

geostat

Geometric mean and variance

gevcdf

Generalized extreme value cumulative distribution function

gevinv

Generalized extreme value inverse cumulative distribution function

gevpdf

Generalized extreme value probability density function

gevrnd

Generalized extreme value random numbers

gevstat

Generalized extreme value mean and variance

gpcdf

Generalized Pareto cumulative distribution function

gpinv

Generalized Pareto inverse cumulative distribution function

gppdf

Generalized Pareto probability density function

gprnd

Generalized Pareto random numbers

gpstat

Generalized Pareto mean and variance

harmmean

Harmonic mean

hygecdf

Hypergeometric cumulative distribution function

hygeinv

Hypergeometric inverse cumulative distribution function

hygepdf

Hypergeometric probability density function

hygernd

Hypergeometric random numbers

hygestat

Hypergeometric mean and variance

icdf

Inverse cumulative distribution function of probability distribution object

iqr

Interquartile range of probability distribution object

kurtosis

Kurtosis

logncdf

Lognormal cumulative distribution function

logninv

Lognormal inverse cumulative distribution function

lognpdf

Lognormal probability density function

lognrnd

Lognormal random numbers

lognstat

Lognormal mean and variance

Mean or median absolute deviation

mnpdf

Multinomial probability density function

moment

Central moments

nancov

Covariance ignoring NaN values

nanmax

Maximum ignoring NaN values

nanmean

Mean ignoring NaN values

nanmedian

Median ignoring NaN values

nanmin

Minimum ignoring NaN values

nanstd

Standard deviation ignoring NaN values

nansum

Sum ignoring NaN values

nanvar

Variance, ignoring NaN values

nbincdf

Negative binomial cumulative distribution function

nbininv

Negative binomial inverse cumulative distribution function

nbinpdf

Negative binomial probability density function

nbinrnd

Negative binomial random numbers

nbinstat

Negative binomial mean and variance

ncfcdf

Noncentral F cumulative distribution function

ncfinv

Noncentral F inverse cumulative distribution function

ncfpdf

Noncentral F probability density function

ncfrnd

Noncentral F random numbers

ncfstat

Noncentral F mean and variance

nctcdf

Noncentral t cumulative distribution function

nctinv

Noncentral t inverse cumulative distribution function

nctpdf

Noncentral t probability density function

nctrnd

Noncentral t random numbers

nctstat

Noncentral t mean and variance

ncx2cdf

Noncentral chi-square cumulative distribution function

ncx2rnd

Noncentral chi-square random numbers

ncx2stat

Noncentral chi-square mean and variance

normcdf

Normal cumulative distribution function

norminv

Normal inverse cumulative distribution function

normpdf

Normal probability density function

normrnd

Normal random numbers

normstat

Normal mean and variance

pdf

Probability density function of probability distribution object

poisscdf

Poisson cumulative distribution function

poissinv

Poisson inverse cumulative distribution function

poisspdf

Poisson probability density function

poissrnd

Poisson random numbers

poisstat

Poisson mean and variance

prctile

Percentiles of a data set

quantile

Quantiles of a data set

randg

Gamma random numbers with unit scale

random

Random numbers

raylcdf

Rayleigh cumulative distribution function

raylinv

Rayleigh inverse cumulative distribution function

raylpdf

Rayleigh probability density function

raylrnd

Rayleigh random numbers

raylstat

Rayleigh mean and variance

skewness

Skewness

tcdf

Student's t cumulative distribution function

tinv

Student's t inverse cumulative distribution function

tpdf

Student's t probability density function

trnd

Student's t random numbers

tstat

Student's t mean and variance

unidcdf

Discrete uniform cumulative distribution function

unidinv

Discrete uniform inverse cumulative distribution function

unidpdf

Discrete uniform probability density function

unidrnd

Discrete uniform random numbers

unidstat

Discrete uniform mean and variance

unifcdf

Continuous uniform cumulative distribution function

unifinv

Continuous uniform inverse cumulative distribution function

unifpdf

Continuous uniform probability density function

unifrnd

Continuous uniform random numbers

unifstat

Continuous uniform mean and variance

wblcdf

Weibull cumulative distribution function

wblinv

Weibull inverse cumulative distribution function

wblpdf

Weibull probability density function

wblrnd

Weibull random numbers

wblstat

Weibull mean and variance

zscore

Standardized z-scores

### String Functions

Function

Description

bin2dec

Convert binary number string to decimal number

bitmax

Maximum double-precision floating-point integer

blanks

Create string of blank characters

char

Create character array (string)

deblank

Strip trailing blanks from end of string

dec2bin

Convert decimal to binary number in string

dec2hex

Convert decimal to hexadecimal number in string

hex2dec

Convert hexadecimal number string to decimal number

hex2num

Convert hexadecimal number string to double-precision number

ischar

True for character array (string)

isletter

Array elements that are alphabetic letters

isspace

Array elements that are space characters

isstrprop

Determine whether string is of specified category

lower

Convert string to lowercase

num2hex

Convert singles and doubles to IEEE hexadecimal strings

strcmp

Compare strings (case sensitive)

strcmpi

Compare strings (case insensitive)

strfind

Find one string within another

strjust

Justify character array

strncmp

Compare first n characters of strings (case sensitive)

strncmpi

Compare first n characters of strings (case insensitive)

strrep

Find and replace substring

strtok

Selected parts of string

strtrim

Remove leading and trailing white space from string

upper

Convert string to uppercase

### Structure Functions

Function

Description

isfield

Determine whether input is structure array field

struct

Create structure

isstruct

Determine whether input is a structure

### Trigonometric Functions

Function

Description

acos

Inverse cosine

acosd

Inverse cosine; result in degrees

acosh

Inverse hyperbolic cosine

acot

acotd

Inverse cotangent; result in degrees

acoth

Inverse hyperbolic cotangent

acsc

acscd

Inverse cosecant; result in degrees

acsch

Inverse cosecant and inverse hyperbolic cosecant

asec

asecd

Inverse secant; result in degrees

asech

Inverse hyperbolic secant

asin

Inverse sine

asinh

Inverse hyperbolic sine

atan

Inverse tangent

atan2

atan2d

Four-quadrant inverse tangent, result in degrees

atand

Inverse tangent; result in degrees

atanh

Inverse hyperbolic tangent

cos

Cosine

cosd

Cosine; result in degrees

cosh

Hyperbolic cosine

cot

cotd

Cotangent; result in degrees

coth

Hyperbolic cotangent

csc

cscd

Cosecant; result in degrees

csch

Hyperbolic cosecant

hypot

Square root of sum of squares

sec

secd

Secant; result in degrees

sech

Hyperbolic secant

sin

Sine

sind

Sine; result in degrees

sinh

Hyperbolic sine

tan

Tangent

tand

Tangent; result in degrees

tanh

Hyperbolic tangent