Products & Services Solutions Academia Support User Community Company

Learn more about Fixed-Point Toolbox   

Supported Functions and Limitations of the Fixed-Point Embedded MATLAB Subset

The Embedded MATLAB subset is a restricted subset of the MATLAB language that provides optimizations for:

The Embedded MATLAB subset supports variable-size arrays and matrices with known upper bounds. To learn more about using variable-size signals in the Embedded MATLAB subset, see Generating Code for Variable-Size Data in the Embedded MATLAB documentation.

The Embedded MATLAB subset supports a significant number of Fixed-Point Toolbox functions, which are listed in the table below. The following general limitations always apply to the use of Fixed-Point Toolbox software with the Embedded MATLAB subset:

To learn about the general limitations of the Embedded MATLAB subset that also apply to use with Fixed-Point Toolbox software, refer to Overview of the Embedded MATLAB Subset in the Embedded MATLAB subset documentation.

Fixed-Point Toolbox Functions Supported for Use with the Embedded MATLAB Language Subset

FunctionRemarks/Limitations

abs

add

all

any

bitand

  • Not supported for slope-bias scaled fi objects.

bitandreduce

bitcmp

bitconcat

bitget

bitor

  • Not supported for slope-bias scaled fi objects.

bitorreduce

bitreplicate

bitrol

bitror

bitset

bitshift

bitsliceget

bitsll

bitsra

bitsrl

bitxor

  • Not supported for slope-bias scaled fi objects.

bitxorreduce

ceil

complex

conj

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 the Embedded MATLAB subset and MATLAB.

    • In the Embedded MATLAB subset, 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 non-scalar. However, if either input is a scalar, MATLAB computes the output using the ProductMode of the governing fimath.

convergent

ctranspose

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.

double

end

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 Embedded MATLAB language subset.

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

fimath

  • Fixed-point signals coming in to an Embedded MATLAB Function block from Simulink are assigned the fimath object defined in the Embedded MATLAB Function block dialog in the Model Explorer.

  • Use to create fimath objects in Embedded MATLAB code.

fix

floor

ge

  • Not supported for fixed-point signals with different biases.

get

  • The syntax structure = get(o) is not supported.

getlsb

getmsb

gt

  • Not supported for fixed-point signals with different biases.

horzcat

imag

intint8int16int32

iscolumn

isempty

isequal

isfi

isfimath

isfimathlocal

isfinite

isinf

isnan

isnumeric

isnumerictype

isreal

isrow

isscalar

issigned

isvector

le

  • Not supported for fixed-point signals with different biases.

length

logical

lowerbound

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

min

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.

mpy

  • When you provide complex inputs to the mpy function inside of an Embedded 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

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 Embedded MATLAB subset and MATLAB.

    • In the Embedded MATLAB subset, 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 non-scalar. However, if either input is a scalar, MATLAB computes the output using the ProductMode of the governing fimath.

ndims

ne

  • Not supported for fixed-point signals with different biases.

nearest

numberofelements

  • numberofelements and numel both work the same as MATLAB numel for fi objects in the Embedded MATLAB language subset.

numerictype

  • Fixed-point signals coming in to an Embedded 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 Embedded MATLAB code.

permute

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

range

rdivide

real

realmax

realmin

reinterpretcast

repmat

rescale

reshape

round

sfi

sign

single

size

sort

sqrt

  • Complex and [Slope Bias] inputs error out.

  • Negative inputs yield a 0 result.

sub

subsasgn

subsref

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 an Embedded 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

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

uint8uint16uint32

uminus

uplus

upperbound

vertcat

  


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-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS