Main Content

RTW.TflArgNumeric Class

Namespace: RTW

Numeric argument for code replacement entry

Description

Use the RTW.TflArgNumeric class to finely control the specification of a numeric argument for a code replacement entry.

Creation

Description

RTW.TflArgNumeric(name,IOType) creates a numeric argument, specifies the name, and specifies whether the argument is an input or an output.

example

Input Arguments

expand all

Argument name, specified as a character vector or string scalar.

Input or output argument, specified as either 'RTW_IO_INPUT' or 'RTW_IO_OUTPUT'.

Properties

expand all

Name of the argument, specified as a character vector or string scalar.

Example: 'u1'

Input or output argument, specified as either 'RTW_IO_INPUT' or 'RTW_IO_OUTPUT'.

Whether to match the slope value of the argument of a fixed-point operator, specified as true (1) or false (0).

Whether to match the bias value of the argument of a fixed-point operator, specified as true (1) or false (0).

Examples

collapse all

In this example, you create a code replacement entry for a fixed-point operation that has a numeric output argument. When you create a code replacement library, include this code in the function that defines the code replacement table.

Create an entry object.

% Create a table object
hTable = RTW.TflTable;

% Create an entry
hEntry = RTW.TflCOperationEntryML;

Create the conceptual representation of the argument by creating an RTW.TflArgNumeric object. Use the object to specify properties of the argument. For example, set the argument as an output.

arg = getTflArgFromString(hTable,'u1', 'int32');
arg.IOType = 'RTW_IO_OUTPUT';

Add the conceptual argument to the entry.

hEntry.addConceptualArg(arg);

After you create the entry, you can set the entry parameters, add other arguments, and add the entry to the code replacement table.

Version History

Introduced in R2007b