RTW.TflArgMatrix Class
Namespace: RTW
Matrix argument for code replacement entry
Description
Use the RTW.TflArgMatrix
class to finely control the specification of a
matrix argument for a code replacement entry.
Creation
Description
Input Arguments
name
— Argument name
character vector | string scalar
Argument name, specified as a character vector or string scalar.
IOType
— Input or output
'RTW_IO_INPUT'
(default) | 'RTW_IO_OUTPUT'
Input or output argument, specified as either 'RTW_IO_INPUT'
or
'RTW_IO_OUTPUT'
.
Properties
Name
— Argument name
character vector | string scalar
Name of the argument, specified as a character vector or string scalar.
Example: 'u1'
IOType
— Input or output
'RTW_IO_INPUT'
(default) | 'RTW_IO_OUTPUT'
Input or output argument, specified as either 'RTW_IO_INPUT'
or
'RTW_IO_OUTPUT'
.
CheckSlope
— Match slope value
true
or 1
(default) | false
or 0
Whether to match the slope value of the base type of the argument for a fixed-point
operator, specified as true
(1
) or
false
(0
).
CheckBias
— Match bias value
true
or 1
(default) | false
or 0
Whether to match the bias value of the base type of the argument for a fixed-point
operator, specified as true
(1
) or
false
(0
).
DimRange
— Range of matrix dimensions
[1; Inf]
(default) | 2-by-N matrix
Range of matrix dimensions, specified as a 2-by-N matrix, where N is the number of
dimensions of the matrix argument. Specify the dimension range in the format
[Dim1Min Dim2Min ... DimNMin; Dim1Max Dim2Max ... DimNMax]
. The
first row specifies the minimum value for each dimension and the second row specifies
the maximum value for each dimension. For example, [2 2; Inf Inf]
means a two-dimensional matrix of size 2-by-2 or larger.
Example: [2 2; Inf Inf]
Examples
Create a Matrix Argument in a Code Replacement Entry
In this example, you create a code replacement entry for a function that takes a matrix as an input argument. When you create a code replacement library, include this code in the function that defines the code replacement table.
Create an entry object and set the parameters for the entry.
% Create an entry hEntry = RTW.TflCOperationEntry; % Create entry parameters hEntry.setTflCOperationEntryParameters(... 'Key', 'RTW_OP_ADD', ... 'Priority', 30, ... 'SaturationMode', 'RTW_WRAP_ON_OVERFLOW', ... 'ImplementationName', 'matrix_sum_4x4_double');
Create the conceptual representation of the input argument by creating an
RTW.TflArgMatrix
object. Use the object to specify properties of
the matrix argument. For example, set the dimension range to [4 4; Inf
Inf]
. The argument must be a two-dimensional matrix of size 4-by-4 or
larger.
arg = RTW.TflArgMatrix('u1', 'RTW_IO_INPUT', 'single'); arg.DimRange = [4 4; Inf Inf];
Add the conceptual argument to the entry.
hEntry.addConceptualArg(arg);
After you create the entry, add the entry to the code replacement table.
Version History
Introduced in R2007b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)