Table 6-2: Target Language Values
Value Type String
|
Example
|
Description
|
"Boolean"
|
1==1
|
Result of a comparison or other Boolean operator. The result will be TLC_TRUE or TLC_FALSE .
|
"Complex"
|
3.0+5.0i
|
A 64-bit double-precision complex number (double on the target machine)
|
"Complex32"
|
3.0F+5.0Fi
|
A 32-bit single-precision complex number (float on the target machine)
|
" File"
|
%openfile x
|
String buffer opened with %openfile
|
" File"
|
%openfile x = "out.c"
|
File opened with %openfile
|
"Function"
|
%function foo...
|
A user-defined function and TLC_FALSE otherwise
|
"Gaussian"
|
3+5i
|
A 32-bit integer imaginary number (int on the target machine)
|
"Identifier"
|
abc
|
Identifier values can only appear within the model.rtw file and cannot appear in expressions (within the context of an expression, identifiers are interpreted as values). To compare against an identifier value, use a string; the identifier will be converted as appropriate to a string.
|
"Matrix"
|
Matrix (3,2) [ [ 1, 2]; [3 , 4]; [ 5, 6] ]
|
Matrices are simply lists of vectors. The individual elements of the matrix do not need to be the same type, and can be any type except vectors or matrices. The Matrix (3,2) text in the example is optional.
|
"Number"
|
15
|
An integer number (int on the target machine)
|
"Range"
|
[1:5]
|
A range of integers between 1 and 5, inclusive
|
"Real"
|
3.14159
|
A floating-point number (double on the target machine), including exponential notation
|
"Real32"
|
3.14159F
|
A 32-bit single-precision floating-point number (float on the target machine)
|
"Scope"
|
Block { ... }
|
A block record
|
"Special"
|
FILE_EXISTS
|
A special built-in function, such as FILE_EXISTS
|
"String"
|
"Hello, World"
|
ASCII character strings. In all contexts, two strings in a row are concatenated to form the final value, as in "Hello, " "World" , which is combined to form "Hello, World" . These strings include all of the ANSI C standard escape sequences such as \n , \r , \t , etc. Use of line continuation characters (i.e. \ and ...) inside of strings is illegal.
|
"Subsystem"
|
<sub1>
|
A subsystem identifier. Within the context of an expansion, be careful to escape the delimiters on a subsystem identifier as in: %<x == <sub\>> .
|
"Unsigned"
|
15U
|
A 32-bit unsigned integer (unsigned int on the target machine)
|
"Unsigned Gaussian"
|
3U+5Ui
|
A 32-bit complex unsigned integer (unsigned int on the target machine)
|
"Vector"
|
[1, 2] or Vector(2) [1, 2]
|
Vectors are lists of values. The individual elements of a vector do not need to be the same type, and may be any type except vectors or matrices.
|