Functions Supported for Code Acceleration or C Code Generation

The following general limitations apply to the use of Fixed-Point Designer™ functions in generated code, with fiaccel:

  • fipref and quantizer objects are not supported.

  • Word lengths greater than 128 bits are not supported.

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

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

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

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

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

An asterisk (*) indicates that the reference page has usage notes and limitations for C/C++ code generation.

abs

Absolute value of fi object

accumneg

Subtract two fi objects or values

accumpos

Add two fi objects or values

add*

Add two objects using fimath object

atan2

Four-quadrant inverse tangent of fixed-point values

bitand*

Bitwise AND of two fi objects

bitandreduce

Reduce consecutive slice of bits to one bit by performing bitwise AND operation

bitcmp

Bitwise complement of fi object

bitconcat

Concatenate bits of fi objects

bitget

Get bits at certain positions

bitor*

Bitwise OR of two fi objects

bitorreduce

Reduce consecutive slice of bits to one bit by performing bitwise OR operation

bitreplicate

Replicate and concatenate bits of fi object

bitrol

Bitwise rotate left

bitror

Bitwise rotate right

bitset

Set bits at certain positions

bitshift

Shift bits specified number of places

bitsliceget

Get consecutive slice of bits

bitsll*

Bit shift left logical

bitsra*

Bit shift right arithmetic

bitsrl*

Bit shift right logical

bitxor*

Bitwise exclusive OR of two fi objects

bitxorreduce

Reduce consecutive slice of bits to one bit by performing bitwise exclusive OR operation

ceil

Round toward positive infinity

complex

Construct complex fi object from real and imaginary parts

conj

Complex conjugate of fi object

conv*

Convolution and polynomial multiplication of fi objects

convergent

Round toward nearest integer with ties rounding to nearest even integer

cordicabs*

CORDIC-based absolute value

cordicangle*

CORDIC-based phase angle

cordicatan2*

CORDIC-based four quadrant inverse tangent

cordiccart2pol*

CORDIC-based approximation of Cartesian-to-polar conversion

cordiccexp*

CORDIC-based approximation of complex exponential

cordiccos*

CORDIC-based approximation of cosine

cordicpol2cart*

CORDIC-based approximation of polar-to-Cartesian conversion

cordicrotate*

Rotate input using CORDIC-based approximation

cordicsin*

CORDIC-based approximation of sine

cordicsincos*

CORDIC-based approximation of sine and cosine

cordicsqrt*

CORDIC-based approximation of square root

cos

Cosine of fi object

ctranspose

Complex conjugate transpose of fi object

divide*

Divide two fi objects

double*

Double-precision floating-point real-world value of fi object

eps*

Quantized relative accuracy for fi or quantizer objects

eq*

Determine whether real-world values of two fi objects are equal

fi*

Construct fixed-point numeric object

filter*

One-dimensional digital filter of fi objects

fimath*

Set fixed-point math settings

fix

Round toward zero

fixed.Quantizer

Quantize fixed-point numbers

floor

Round toward negative infinity

for

Execute statements specified number of times

ge*

Determine whether real-world value of one fi object is greater than or equal to another

get*

Property values of object

getlsb

Least significant bit

getmsb

Most significant bit

gt*

Determine whether real-world value of one fi object is greater than another

horzcat

Horizontally concatenate multiple fi objects

int16

Convert fi object to signed 16-bit integer

int32

Convert fi object to signed 32-bit integer

int64

Convert fi object to signed 64-bit integer

int8

Convert fi object to signed 8-bit integer

isequal

Determine whether real-world values of two fi objects are equal, or determine whether properties of two fimath, numerictype, or quantizer objects are equal

isfi*

Determine whether variable is fi object

isfimath

Determine whether variable is fimath object

isfimathlocal

Determine whether fi object has local fimath

isnumerictype

Determine whether input is numerictype object

issigned

Determine whether fi object is signed

le*

Determine whether real-world value of fi object is less than or equal to another

lowerbound

Lower bound of range of fi object

lsb*

Scaling of least significant bit of fi object, or value of least significant bit of quantizer object

lt*

Determine whether real-world value of one fi object is less than another

max

Largest element in array of fi objects

mean

Average or mean value of fixed-point array

median

Median value of fixed-point array

min

Smallest element in array of fi objects

minus*

Matrix difference between fi objects

mpower*

Fixed-point matrix power (^)

mpy*

Multiply two objects using fimath object

mrdivide

Right-matrix division

mtimes*

Matrix product of fi objects

ne*

Determine whether real-world values of two fi objects are not equal

nearest

Round toward nearest integer with ties rounding toward positive infinity

nextpow2*

Exponent of next higher power of 2 of fi object

normalizedReciprocal

Compute normalized reciprocal

numel

Number of data elements in fi array

numerictype*

Construct numerictype object

plus*

Matrix sum of fi objects

pow2

Efficient fixed-point multiplication by 2K

power*

Fixed-point element-wise power

qr

Orthogonal-triangular decomposition

quantize

Quantize fixed-point numbers

range

Numerical range of fi or quantizer object

rdivide

Right-array division

realmax

Largest positive fixed-point value or quantized number

realmin

Smallest positive normalized fixed-point value or quantized number

reinterpretcast

Convert fixed-point data types without changing underlying data

removefimath

Remove fimath object from fi object

rescale

Change scaling of fi object

round

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

setfimath

Attach fimath object to fi object

sfi*

Construct signed fixed-point numeric object

sign

Perform signum function on array

sin

Sine of fixed-point values

single*

Single-precision floating-point real-world value of fi object

sort*

Sort elements of real-valued fi object in ascending or descending order

sqrt*

Square root of fi object

storedInteger

Stored integer value of fi object

storedIntegerToDouble

Convert stored integer value of fi object to built-in double value

sub*

Subtract two objects using fimath object

subsasgn

Subscripted assignment

subsref

Subscripted reference

sum*

Sum of array elements

times*

Element-by-element multiplication of fi objects

ufi*

Construct unsigned fixed-point numeric object

uint16

Convert fi object to unsigned 16-bit integer

uint32

Stored integer value of fi object as built-in uint32

uint64

Convert fi object to unsigned 64-bit integer

uint8

Convert fi object to unsigned 8-bit integer

uminus

Negate elements of fi object array

upperbound

Upper bound of range of fi object

vertcat

Vertically concatenate multiple fi objects