Main Content


Create code replacement argument based on specified name and built-in data type



arg = getTflArgFromString(hTable,name,datatype) creates a code replacement argument that is based on a specified name and built-in or fixed-point data type.

The IOType property of the created argument defaults to 'RTW_IO_INPUT', indicating an input argument. For an output argument, change the IOType value to 'RTW_IO_OUTPUT' by directly assigning the argument property.

This function does not support matrices. To create a matrix argument, use the argument class RTW.TflArgMatrix as shown in Small Matrix Operation to Processor Code Replacement, Matrix Multiplication Operation to MathWorks BLAS Code Replacement, and Matrix Multiplication Operation to ANSI/ISO C BLAS Code Replacement.


collapse all

This example shows how to use getTflArgFromString to create an int16 output argument named y1. Then, the example adds the argument as a conceptual argument for a code replacement table entry.

hLib = RTW.TflTable;
op_entry = RTW.TflCOperationEntry;
arg = hLib.getTflArgFromString('y1', 'int16');
arg.IOType = 'RTW_IO_OUTPUT';

Input Arguments

collapse all

The hTable is a handle to a code replacement table previously returned by hTable = RTW.TflTable.

Example: hLib

Example: 'y1'

You can specify fixed-point data types using the fixdt function from Fixed-Point Designer™ software; for example, 'fixdt(1,16,2)'.

Example: 'integer'

Output Arguments

collapse all

The arg is a handle to the created code replacement argument, which can be specified to the addConceptualArg function.

Introduced in R2008a