Symbol
Description
Define C Function block symbols and their properties.
Creation
Access a Symbol
object through one of the following methods.
addSymbol
functiongetSymbol
functionAccess the
Symbols
property of aSymbolSpec
object.
Properties
Name
— Symbol name in source code
character vector
Symbol name in source code, specified as a character vector.
Data Types: character
PortNumber
— Port number
scalar integer
Port number, specified as a scalar integer. For input and output symbols,
PortNumber
indicates the port index on the block. For parameter
symbols, PortNumber
indicates the order that the symbol appears in
the block parameter mask.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Size
— Size dimensions of the symbol
'1'
(default) | character vector
Size of the symbol data specified as a character vector containing a scalar integer.
The C Function block supports only scalars and vectors. Matrices and
higher-dimension arrays are not supported. You can use a size expression to define the
size of an output. Use -1
to inherit size.
Data Types: character
Type
— Data type of symbol
'double' (default) | character vector
Data type of the symbol, specified as a character vector that evaluates to a numeric
data type, or as a Simulink.AliasType
object.
Example: mySymbol.DataType = 'int32'
Data Types: char
Scope
— Scope of the symbol
'Input'
(default) | 'Output'
| 'Persistent'
| 'Parameter'
| 'Constant'
Scope of the symbol, specified as one of the following values.
Input
— Input symbol to the C Function block.Output
— Output symbol to the C Function block.Parameter
— Define a symbol as parameter. The parameter name is defined by theLabel
property of the symbol.Persistent
— Define a symbol as persistent data.You can define a void pointer using the
Persistent
scope in the C Function block. A void pointer is a pointer that can store any type of data that you create or allocate.Constant
— Define a symbol as constant using value-size or numeric expressions.
Data Types: character
Label
— Symbol label
character vector
Symbol label, specified as a character vector. For symbols with their scope set to
Input
or Output
, this label appears as the port
name on the block. For symbols with their scope set to Parameter
,
this label is the label that appears on the block parameter mask. If the scope is
Constant
, the label is the constant expression. You cannot define a
label for Persistent
symbols.
Data Types: character
Version History
Introduced in R2020a
See Also
Functions
Objects
Blocks
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)