Skip to Main Content Skip to Search
Product Documentation

Functions Supported for Code Acceleration and Code Generation from MATLAB

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

FunctionRemarks/Limitations

abs

N/A

add

N/A

all

N/A

any

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

N/A

bitsra

N/A

bitsrl

N/A

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

ctranspose

N/A

diag

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

disp

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

  • Use to create a fixed-point constant or variable in the generated code.

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

  • The syntax fi('PropertyName',PropertyValue...) is not supported. To use property name/property value pairs, you must first specify the value v of the fi object as in fi(v,'PropertyName',PropertyValue...).

  • Works for all input values when complete numerictype information of the fi object is provided.

  • Works only for constant input values (value of input must be known at compile time) when complete numerictype information of the fi object is not specified.

  • 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

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.

horzcat

N/A

imag

N/A

intint8int16int32

N/A

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

  • The exponent input, k, must be constant; that is, its value must be known at compile time.

  • 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 the generated code and MATLAB.

    • In the generated code, the output for variable-sized signals is always 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 Specify precision 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 always 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 and numel both work the same as MATLAB numel for fi objects in the generated code.

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 input 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

The exponent input, k, must be constant; that is, its value must be known at compile time.

range

N/A

rdivide

N/A

real

N/A

realmax

N/A

realmin

N/A

reinterpretcast

N/A

repmat

N/A

rescale

N/A

reshape

N/A

round

N/A

sfi

N/A

sign

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.

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

uint8uint16uint32

N/A

uminus

N/A

uplus

N/A

upperbound

N/A

vertcat

N/A

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS