Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

数据类型

为信号和模块参数指定特定的数据类型,定义枚举

在模型中,用数据类型来确定信号与模块参数之间的交互方式。数值数据类型用来确定计算机如何在内存中存储信号和参数,以及计算机如何执行数学运算。其他 Simulink® 数据类型用来确定信号及参数的结构或允许的值。

要仿真计算机硬件的数学行为,或从模型中生成有效的代码,您可以控制信号和参数的数值数据类型。您可以指定浮点数、整数、定点和其他数值类型。请参阅 Simulink 支持的数据类型

枚举数据类型只允许信号和参数使用您指定的一组值。您可以通过为每个枚举值提供一个有意义的名称来提高模型的可读性。要在 Simulink 中使用枚举,请参阅在 Simulink 模型中使用枚举数据

您可以使用总线类型将多个信号或参数组合到一起,这样可以提高模型的可读性,而且便于维护模型。请参阅总线的数据类型

通过使用字符串类型,您可以轻松地在模型中使用字符串。

模块

全部展开

Block Support TableView data type support for Simulink blocks
Data Type Conversion将输入信号转换为指定的数据类型
Data Type Conversion Inherited使用继承的数据类型和定标将一种数据类型转换为另一种
Data Type DuplicateForce all inputs to same data type
Data Type PropagationSet data type and scaling of propagated signal based on information from reference signals
Data Type Scaling StripRemove scaling and map to built in integer
ASCII to StringUint8 vector signal to string signal
Compose StringCompose output string signal based on specified format and input signals
Scan String扫描输入字符串并转换为指定格式的信号
String Compare比较两个输入字符串
String Concatenate串联各个输入字符串以形成一个输出字符串。
String Constant输出指定的字符串
String ContainsDetermine if string contains, starts with, or ends with pattern (自 R2020a 起)
String CountCount occurrences of pattern in string (自 R2020a 起)
String FindReturn index of first occurrence of pattern string
String LengthOutput number of characters in input string
String to ASCIIConvert string signal to uint8 vector
String to Double将字符串信号转换为双精度信号。
String to EnumInput string signal to enumerated signal
String to Single将字符串信号转换为单个信号
SubstringExtract substring from input string signal
To String将输入信号转换为字符串信号

函数

全部展开

enumeration类枚举成员和名称
Simulink.defineIntEnumType定义枚举数据类型
Simulink.findIntEnumTypeFind enumeration classes defined by Simulink.defineIntEnumType
Simulink.clearIntEnumTypeDelete enumeration classes defined by Simulink.defineIntEnumType
Simulink.data.getEnumTypeInfoGet information about enumerated data type
Simulink.data.isSupportedEnumClassDetermine whether an enumeration class is valid for Simulink
Simulink.data.isSupportedEnumObjectDetermine whether an enumeration object is valid for Simulink
fixdt创建描述定点或浮点数据类型的 Simulink.NumericType 对象
fixpt_evenspace_cleanupModify breakpoints of lookup table to have even spacing
fixpt_look1_func_approx通过插入查找表数据点来优化非线性函数的定点逼近
fixpt_look1_func_plotPlot fixed-point approximation function for lookup table
fixpt_set_allSet property for each fixed-point block in subsystem
fixptbestexpExponent that gives best precision for fixed-point representation of value
fixptbestprecDetermine maximum precision available for fixed-point representation of value
Simulink.importExternalCTypes生成由 C 或 C++ 代码定义的自定义数据类型的 Simulink 表示
tunablevars2parameterobjectsCreate Simulink parameter objects from tunable parameters
stringtypeCreate string data type
showblockdatatypetableDisplay HTML page of Simulink block data type support
Simulink.Block.getInternalDataTypeGet data type of block parameter (自 R2023a 起)

Simulink.AliasType为信号和参数数据类型创建别名
Simulink.NumericType指定浮点数、整数或定点数据类型

主题

相关信息