Documentation

Fixed-Point Designer Functions

Alphabetical List By Category

Fixed-Point Basics

Fixed-Point Basics in MATLAB

fiConstruct fixed-point numeric object
ufiConstruct unsigned fixed-point numeric object
sfiConstruct signed fixed-point numeric object
fimathSet fixed-point math settings
fiprefSet fixed-point preferences
numerictypeConstruct numerictype object
accumposAdd two fi objects or values
accumnegSubtract two fi objects or values
quantizeQuantize fixed-point numbers
binBinary representation of stored integer of fi object
decUnsigned decimal representation of stored integer of fi object
doubleDouble-precision floating-point real-world value of fi object
hexHexadecimal representation of stored integer of fi object
removefimathRemove fimath object from fi object
setfimathAttach fimath object to fi object
globalfimathConfigure global fimath and return handle object
removeglobalfimathprefRemove global fimath preference
resetglobalfimathSet global fimath to MATLAB factory default
storedIntegerStored integer value of fi object
storedIntegerToDoubleConvert stored integer value of fi object to built-in double value
embedded.fiFixed-point numeric object
embedded.fimathfimath object
embedded.numerictypenumerictype object

Fixed-Point Design for MATLAB Code

Fixed-Point Functions

Math

Array and Matrix Operations
Array Creation and Concatenation
diagDiagonal matrices or diagonals of matrix
eyeCreate identity matrix with fixed-point properties
ndgridGenerate arrays for N-D functions and interpolation
onesCreate array of all ones with fixed-point properties
zerosCreate array of all zeros with fixed-point properties
Array and Matrix Manipulation
flipFlip order of elements
fliplrFlip matrix left to right
flipudFlip matrix up to down
horzcatHorizontally concatenate multiple fi objects
ipermuteInverse permute dimensions of multidimensional array
permuteRearrange dimensions of multidimensional array
repmatReplicate and tile array
reshapeReshape array
shiftdimShift dimensions
sortSort elements of real-valued fi object in ascending or descending order
squeezeRemove singleton dimensions
vertcatVertically concatenate multiple fi objects
Basic Array and Matrix Information
colonCreate vectors, array subscripting
endLast index of array
iscolumnDetermine whether fi object is column vector
isemptyDetermine whether array is empty
isrowDetermine whether fi object is row vector
isscalarDetermine whether input is scalar
isvectorDetermine whether input is vector
lengthVector length
ndimsNumber of array dimensions
numelNumber of data elements in fi array
sizeArray dimensions
isequalDetermine whether real-world values of two fi objects are equal, or determine whether properties of two fimath, numerictype, or quantizer objects are equal
isequivalentDetermine if two numerictype objects have equivalent properties
isfloatDetermine whether input is floating-point data type
isfiniteDetermine whether array elements are finite
isinfDetermine whether array elements are infinite
isnanDetermine whether array elements are NaN
isnumericDetermine whether input is numeric array
maxLargest element in array of fi objects
minSmallest element in array of fi objects
dispDisplay object
isobjectDetermine whether input is MATLAB object
numberofelementsNumber of data elements in an array
Array and Matrix Operators
bufferBuffer signal vector into matrix of data frames
colonCreate vectors, array subscripting
ctransposeComplex conjugate transpose of fi object
minusMatrix difference between fi objects
mpowerFixed-point matrix power (^)
mtimesMatrix product of fi objects
plusMatrix sum of fi objects
qrOrthogonal-triangular decomposition
rdivideRight-array division (./)
shiftdataShift data to operate on specified dimension
sumSum of array elements
surfnormCompute and display 3-D surface normals
timesElement-by-element multiplication of fi objects
transposeTranspose operation
trilLower triangular part of matrix
triuUpper triangular part of matrix
uminusNegate elements of fi object array
unshiftdataInverse of shiftdata
uplusUnary plus
Specialized Matrices
hankelHankel matrix
toeplitzCreate Toeplitz matrix
Sparse Matrices
spyVisualize sparsity pattern
etreeplotPlot elimination tree
gplotPlot set of nodes using adjacency matrix
treeplotPlot picture of tree
Complex Math
complexConstruct complex fi object from real and imaginary parts
conjComplex conjugate of fi object
absAbsolute value of fi object
imagImaginary part of complex number
realReal part of complex number
signPerform signum function on array
isrealDetermine whether array elements are real
Constants
epsQuantized relative accuracy for fi or quantizer objects
intmaxLargest positive stored integer value representable by numerictype of fi object
intminSmallest stored integer value representable by numerictype of fi object
CORDIC
cordicabsCORDIC-based absolute value
cordicangleCORDIC-based phase angle
cordicatan2CORDIC-based four quadrant inverse tangent
cordiccart2polCORDIC-based approximation of Cartesian-to-polar conversion
cordiccexpCORDIC-based approximation of complex exponential
cordiccosCORDIC-based approximation of cosine
cordicpol2cartCORDIC-based approximation of polar-to-Cartesian conversion
cordicrotateRotate input using CORDIC-based approximation
cordicsinCORDIC-based approximation of sine
cordicsincosCORDIC-based approximation of sine and cosine
cordicsqrtCORDIC-based approximation of square root
cordictanhCORDIC-based hyperbolic tangent
Exponentials
pow2Efficient fixed-point multiplication by 2K
powerFixed-point array power (.^)
sqrtSquare root of fi object
Math Operations
accumnegSubtract two fi objects or values
accumposAdd two fi objects or values
addAdd two objects using fimath object
atan2Four-quadrant inverse tangent of fixed-point values
convConvolution and polynomial multiplication of fi objects
convergentRound toward nearest integer with ties rounding to nearest even integer
cosCosine of fi object
divideDivide two objects
filterOne-dimensional digital filter of fi objects
innerprodintbitsNumber of integer bits needed for fixed-point inner product
mpyMultiply two objects using fimath object
mrdivideForward slash (/) or right-matrix division
sinSine of fixed-point values
subSubtract two objects using fimath object
Radix Conversion
binBinary representation of stored integer of fi object
bin2numConvert two's complement binary string to number using quantizer object
decUnsigned decimal representation of stored integer of fi object
hexHexadecimal representation of stored integer of fi object
num2binConvert number to binary representation using quantizer object
num2intConvert number to signed integer
octOctal representation of stored integer of fi object
sdecSigned decimal representation of stored integer of fi object
num2hexConvert number to hexadecimal equivalent using quantizer object
hex2numConvert hexadecimal string to number using quantizer object
Rounding and Remainders
ceil Round toward positive infinity
fixRound toward zero
floorRound toward negative infinity
modModulus after division for fi objects
nearestRound toward nearest integer with ties rounding toward positive infinity
roundRound fi object toward nearest integer or round input data using quantizer object
Statistics
errmeanMean of quantization error
errpdfProbability density function of quantization error
errvarVariance of quantization error
logreportQuantization report
maxlogLog maximums
minlogLog minimums
noperationsNumber of operations
noverflowsNumber of overflows
nunderflowsNumber of underflows
resetlogClear log for fi or quantizer object
meanAverage or mean value of fixed-point array
medianMedian value of fixed-point array

Simulation Acceleration

fiaccelAccelerate fixed-point code and convert floating-point MATLAB code to fixed-point MATLAB code
coder.allowpcodeControl code generation from protected MATLAB files
coder.constFold expressions into constants in generated code
coder.cstructnameName structure in generated code
coder.extrinsicDeclare extrinsic function or functions
coder.inlineControl inlining in generated code
coder.mexconfigCode acceleration configuration object
coder.newtypeCreate a coder.Type object
coder.nullcopyDeclare uninitialized variables
coder.resizeResize a coder.Type object
coder.screenerDetermine if function is suitable for code generation
coder.targetDetermine if code generation target is specified target
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.varsizeDeclare variable-size array
coder.ArrayTypeRepresent set of MATLAB arrays
coder.CellTypeRepresent set of MATLAB cell arrays
coder.ConstantRepresent set containing one MATLAB value
coder.EnumTypeRepresent set of MATLAB enumerations
coder.FiTypeRepresent set of MATLAB fixed-point arrays
coder.MexConfigCode acceleration configuration object for use with fiaccel
coder.PrimitiveTypeRepresent set of logical, numeric, or char arrays
coder.StructTypeRepresent set of MATLAB structure arrays
coder.TypeRepresent set of MATLAB values

Graphics

3-D Visualization
meshCreate mesh plot
meshcCreate mesh plot with contour plot
meshzCreate mesh plot with curtain plot
surfCreate 3-D shaded surface plot
surfcCreate 3-D shaded surface plot with contour plot
surflCreate surface plot with colormap-based lighting
trimeshCreate triangular mesh plot
triplotCreate 2-D triangular plot
trisurfCreate triangular surface plot
streamribbonCreate 3-D stream ribbon plot
streamsliceDraw streamlines in slice planes
streamtubeCreate 3-D stream tube plot
rgbplotPlot colormap
coneplotPlot velocity vectors as cones in 3-D vector field
Basic Plots and Graphs
errorbarPlot error bars along curve
lineCreate line object
loglogCreate log-log scale plot
plotCreate linear 2-D plot
plot3Create 3-D line plot
plotyyCreate graph with y-axes on right and left sides
polarPlot polar coordinates
semilogxCreate semilogarithmic plot with logarithmic x-axis
semilogyCreate semilogarithmic plot with logarithmic y-axis
xlimSet or query x-axis limits
ylimSet or query y-axis limits
zlimSet or query z-axis limits
clabelCreate contour plot elevation labels
textCreate text object in current axes
copyobjMake independent copy of quantizer object
Specialized Plots
areaCreate filled area 2-D plot
barCreate vertical bar graph
barhCreate horizontal bar graph
contourCreate contour graph of matrix
contour3Create 3-D contour plot
contourcCreate two-level contour plot computation
contourfCreate filled 2-D contour plot
ezcontourEasy-to-use contour plotter
ezcontourfEasy-to-use filled contour plotter
cometCreate 2-D comet plot
comet3Create 3-D comet plot
featherPlot velocity vectors
quiverCreate quiver or velocity plot
quiver3Create 3-D quiver or velocity plot
stairsCreate stairstep graph
stemPlot discrete sequence data
stem3Plot 3-D discrete sequence data
ezmeshEasy-to-use 3-D mesh plotter
ezplotEasy-to-use function plotter
ezplot3Easy-to-use 3-D parametric curve plotter
ezpolarEasy-to-use polar coordinate plotter
ezsurfEasy-to-use 3-D colored surface plotter
ezsurfcEasy-to-use combination surface/contour plotter
fplotPlot function between specified limits
histCreate histogram plot
histcHistogram count
roseCreate angle histogram
plotmatrixDraw scatter plots
scatterCreate scatter or bubble plot
scatter3Create 3-D scatter or bubble plot
pcolorCreate pseudocolor plot
ribbonCreate ribbon plot
sliceCreate volumetric slice plot
waterfallCreate waterfall plot
voronoiCreate Voronoi diagram
voronoinCreate n-D Voronoi diagram
compassPlot arrows emanating from origin
patchCreate patch graphics object

Relational Operators

eqDetermine whether real-world values of two fi objects are equal
geDetermine whether real-world value of one fi object is greater than or equal to another
gtDetermine whether real-world value of one fi object is greater than another
leDetermine whether real-world value of fi object is less than or equal to another
ltDetermine whether real-world value of one fi object is less than another
neDetermine whether real-world values of two fi objects are not equal

Programming and Data Types

Object-Oriented Programming
fiConstruct fixed-point numeric object
fiprefSet fixed-point preferences
savefiprefSave fi preferences for next MATLAB session
fimathSet fixed-point math settings
numerictypeConstruct numerictype object
quantizerConstruct quantizer object
assignmentquantizerAssignment quantizer object of fi object
mat2strConvert matrix to string
getProperty values of object
subsasgnSubscripted assignment
subsrefSubscripted reference
removefimathRemove fimath object from fi object
resetReset objects to initial conditions
setSet or display property values for quantizer objects
setfimathAttach fimath object to fi object
sfiConstruct signed fixed-point numeric object
tostringConvert numerictype or quantizer object to string
ufiConstruct unsigned fixed-point numeric object
unitquantizerConstructor for unitquantizer object
fixed.aggregateTypeCompute aggregate numerictype
Data Type Operators and Tools
storedIntegerStored integer value of fi object
storedIntegerToDoubleConvert stored integer value of fi object to built-in double value
reinterpretcastConvert fixed-point data types without changing underlying data
rescaleChange scaling of fi object
stripscalingStored integer of fi object
buildInstrumentedMexGenerate compiled C code function including logging instrumentation
clearInstrumentationResultsClear results logged by instrumented, compiled C code function
NumericTypeScopeDetermine fixed-point data type
showInstrumentationResultsResults logged by instrumented, compiled C code function
doubleDouble-precision floating-point real-world value of fi object
int16Convert fi object to signed 16-bit integer
int32Convert fi object to signed 32-bit integer
int64Convert fi object to signed 64-bit integer
int8Convert fi object to signed 8-bit integer
singleSingle-precision floating-point real-world value of fi object
uint16Convert fi object to unsigned 16-bit integer
uint32Stored integer value of fi object as built-in uint32
uint64Convert fi object to unsigned 64-bit integer
uint8Convert fi object to unsigned 8-bit integer
logicalConvert numeric values to logical
realmaxLargest positive fixed-point value or quantized number
realminSmallest positive normalized fixed-point value or quantized number
Bitwise Operations
bitandBitwise AND of two fi objects
bitorBitwise OR of two fi objects
bitxorBitwise exclusive OR of two fi objects
bitandreduceReduce consecutive slice of bits to one bit by performing bitwise AND operation
bitorreduceReduce consecutive slice of bits to one bit by performing bitwise OR operation
bitxorreduceReduce consecutive slice of bits to one bit by performing bitwise exclusive OR operation
bitrorBitwise rotate right
bitshiftShift bits specified number of places
bitrolBitwise rotate left
bitsllBit shift left logical
bitsraBit shift right arithmetic
bitsrlBit shift right logical
bitcmpBitwise complement of fi object
bitconcatConcatenate bits of fi objects
bitreplicateReplicate and concatenate bits of fi object
bitgetGet bits at certain positions
bitsetSet bits at certain positions
bitslicegetGet consecutive slice of bits
getlsbLeast significant bit
getmsbMost significant bit
Logical Operations
allDetermine whether all array elements are nonzero
andFind logical AND of array or scalar inputs
anyDetermine whether any array elements are nonzero
notFind logical NOT of array or scalar input
orFind logical OR of array or scalar inputs
xorLogical exclusive-OR

Data Analysis

denormalmaxLargest denormalized quantized number for quantizer object
denormalminSmallest denormalized quantized number for quantizer object
fractionlengthFraction length of quantizer object
lowerboundLower bound of range of fi object
lsbScaling of least significant bit of fi object, or value of least significant bit of quantizer object
rangeNumerical range of fi or quantizer object
upperboundUpper bound of range of fi object
wordlengthWord length of quantizer object
sortSort elements of real-valued fi object in ascending or descending order
exponentbiasExponent bias for quantizer object
exponentlengthExponent length of quantizer object
exponentmaxMaximum exponent for quantizer object
exponentminMinimum exponent for quantizer object
isbooleanDetermine whether input is Boolean
isdoubleDetermine whether input is double-precision data type
isfiDetermine whether variable is fi object
isfimathDetermine whether variable is fimath object
isfimathlocalDetermine whether fi object has local fimath
isfiprefDetermine whether input is fipref object
isfixedDetermine whether input is fixed-point data type
isnumerictypeDetermine whether input is numerictype object
ispropequalDetermine whether properties of two fi objects are equal
isquantizerDetermine whether input is quantizer object
isscaleddoubleDetermine whether input is scaled double data type
isscaledtypeDetermine whether input is fixed-point or scaled double data type
isscalingbinarypointDetermine whether input has binary point scaling
isscalingslopebiasDetermine whether input has nontrivial slope and bias scaling
isscalingunspecifiedDetermine whether input has unspecified scaling
issignedDetermine whether fi object is signed
issingleDetermine whether input is single-precision data type
isslopebiasscaledDetermine whether numerictype object has nontrivial slope and bias

Data Quantizing

castCast variable to different data type
quantizeQuantize fixed-point numbers
fixed.QuantizerQuantize fixed-point numbers
quantizerConstruct quantizer object
quantize methodApply quantizer object to data
randquantGenerate uniformly distributed, quantized random number using quantizer object
unitquantizeQuantize except numbers within eps of +1
unitquantizerConstructor for unitquantizer object

Algorithm Implementation

bitandBitwise AND of two fi objects
bitorBitwise OR of two fi objects
bitshiftShift bits specified number of places
cordicabsCORDIC-based absolute value
cordicangleCORDIC-based phase angle
cordicatan2CORDIC-based four quadrant inverse tangent
cordiccart2polCORDIC-based approximation of Cartesian-to-polar conversion
cordiccexpCORDIC-based approximation of complex exponential
cordiccosCORDIC-based approximation of cosine
cordicpol2cartCORDIC-based approximation of polar-to-Cartesian conversion
cordicrotateRotate input using CORDIC-based approximation
cordicsinCORDIC-based approximation of sine
cordicsincosCORDIC-based approximation of sine and cosine
cordicsqrtCORDIC-based approximation of square root
fiConstruct fixed-point numeric object
filterOne-dimensional digital filter of fi objects
forExecute statements specified number of times
meanAverage or mean value of fixed-point array
medianMedian value of fixed-point array
sqrtSquare root of fi object

Algorithm Acceleration

Algorithm Design for Acceleration

Data Definition
Variable-Size Data
coder.varsizeDeclare variable-size array
Cell Arrays
coder.varsizeDeclare variable-size array
coder.cstructnameName structure in generated code
coder.CellTypeRepresent set of MATLAB cell arrays
MATLAB Classes
coder.ClassTypeRepresent set of MATLAB classes
Function Definition
coder.extrinsicDeclare extrinsic function or functions
coder.ignoreConstPrevent use of constant value of expression for function specializations
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration

Accelerated Algorithm Generation

Input Specification
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.resizeResize a coder.Type object
coder.newtypeCreate a coder.Type object
coder.varsizeDeclare variable-size array
coder.ArrayTypeRepresent set of MATLAB arrays
coder.CellTypeRepresent set of MATLAB cell arrays
coder.ClassTypeRepresent set of MATLAB classes
coder.ConstantRepresent set containing one MATLAB value
coder.EnumTypeRepresent set of MATLAB enumerations
coder.FiTypeRepresent set of MATLAB fixed-point arrays
coder.PrimitiveTypeRepresent set of logical, numeric, or char arrays
coder.StructTypeRepresent set of MATLAB structure arrays
coder.TypeRepresent set of MATLAB values
Build Configuration
coder.mexconfigCode acceleration configuration object
fiaccelAccelerate fixed-point code and convert floating-point MATLAB code to fixed-point MATLAB code
coder.MexConfigCode acceleration configuration object for use with fiaccel
Creation of Accelerated Executable
fiaccelAccelerate fixed-point code and convert floating-point MATLAB code to fixed-point MATLAB code
coder.allowpcodeControl code generation from protected MATLAB files
coder.constFold expressions into constants in generated code
coder.cstructnameName structure in generated code
coder.extrinsicDeclare extrinsic function or functions
coder.inlineControl inlining in generated code
coder.loadLoad compile-time constants from MAT-file or ASCII file into caller workspace
coder.newtypeCreate a coder.Type object
coder.nullcopyDeclare uninitialized variables
coder.resizeResize a coder.Type object
coder.targetDetermine if code generation target is specified target
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.varsizeDeclare variable-size array
coder.mexconfigCode acceleration configuration object
coder.ArrayTypeRepresent set of MATLAB arrays
coder.ConstantRepresent set containing one MATLAB value
coder.EnumTypeRepresent set of MATLAB enumerations
coder.FiTypeRepresent set of MATLAB fixed-point arrays
coder.PrimitiveTypeRepresent set of logical, numeric, or char arrays
coder.StructTypeRepresent set of MATLAB structure arrays
coder.TypeRepresent set of MATLAB values
coder.MexConfigCode acceleration configuration object for use with fiaccel
Code Analysis
coder.screenerDetermine if function is suitable for code generation

Algorithm Conversion

Automated Conversion

fiaccelAccelerate fixed-point code and convert floating-point MATLAB code to fixed-point MATLAB code
coder.configCreate configuration object for fixed-point or single-precision conversion
coder.mexconfigCode acceleration configuration object
coder.approximationCreate function replacement configuration object
coder.allowpcodeControl code generation from protected MATLAB files
coder.constFold expressions into constants in generated code
coder.extrinsicDeclare extrinsic function or functions
coder.inlineControl inlining in generated code
coder.loadLoad compile-time constants from MAT-file or ASCII file into caller workspace
coder.newtypeCreate a coder.Type object
coder.nullcopyDeclare uninitialized variables
coder.resizeResize a coder.Type object
coder.targetDetermine if code generation target is specified target
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.varsizeDeclare variable-size array
coder.MexConfigCode acceleration configuration object for use with fiaccel
coder.FixptConfigFloating-point to fixed-point conversion configuration object
coder.ArrayTypeRepresent set of MATLAB arrays
coder.ConstantRepresent set containing one MATLAB value
coder.EnumTypeRepresent set of MATLAB enumerations
coder.FiTypeRepresent set of MATLAB fixed-point arrays
coder.PrimitiveTypeRepresent set of logical, numeric, or char arrays
coder.StructTypeRepresent set of MATLAB structure arrays
coder.TypeRepresent set of MATLAB values

Manual Conversion

buildInstrumentedMexGenerate compiled C code function including logging instrumentation
showInstrumentationResultsResults logged by instrumented, compiled C code function
clearInstrumentationResultsClear results logged by instrumented, compiled C code function
fiConstruct fixed-point numeric object
fimathSet fixed-point math settings
numerictypeConstruct numerictype object
zerosCreate array of all zeros with fixed-point properties
onesCreate array of all ones with fixed-point properties
castCast variable to different data type

Fixed-Point Design for Simulink Models

Convert to Fixed Point

Prepare System for Conversion

DataTypeWorkflow.ConverterCreate fixed-point converter object

Collect Ranges

DataTypeWorkflow.ConverterCreate fixed-point converter object

Convert to Fixed Point

ntsDetermine fixed-point data type
DataTypeWorkflow.ConverterCreate fixed-point converter object
DataTypeWorkflow.ProposalSettingsProposal settings object for data type proposals

Verify Fixed-Point Conversion

DataTypeWorkflow.ConverterCreate fixed-point converter object
DataTypeWorkflow.ResultObject containing run result information
DataTypeWorkflow.DiffRunResultResults from comparing two simulation runs
DataTypeWorkflow.DiffSignalResultResults from comparing two signals

Single-Precision Design for MATLAB Code

convertToSingleConvert double-precision MATLAB code to single-precision MATLAB code
coder.configCreate configuration object for fixed-point or single-precision conversion
coder.SingleConfigDouble-precision to single-precision conversion configuration object

Single-Precision Design for Simulink

DataTypeWorkflow.Single.convertToSingleConvert a double-precision system to single precision
Was this topic helpful?