Main Content

数据类型

Assign specific data types to signals and block parameters, define enumerations

在模型中,数据类型确定信号和块参数之间的交互。数字数据类型确定计算机如何将信号和参数存储在内存中以及计算机如何执行数学操作。其他模拟金宝app®数据类型确定信号和参数的结构或允许值。

To simulate the mathematical behavior of computer hardware, or to generate efficient code from a model, you can control the numeric data types of signals and parameters. You can specify floating-point, integer, fixed-point, and other numeric types. SeeSimulink支持的金宝app数据类型金宝app

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

您可以使用总线类型将多个信号或参数分组在一起,从而可以改善模型可读性和易于模型维护。看数据类型for Buses

您可以使用字符串类型轻松使用型号中的字符串。

Blocks

expand all

块支持表金宝app View data type support for金宝app
Data Type Conversion Convert input signal to specified data type
数据类型转换继承 Convert from one data type to another using inherited data type and scaling
数据类型重复 强制所有输入到同一数据类型
数据类型传播 Set data type and scaling of propagated signal based on information from reference signals
数据类型缩放条 Remove scaling and map to built in integer
ASCII to String UINT8向量信号到字符串信号
Compose String 基于指定格式和输入信号撰写输出字符串信号
Scan String 扫描输入的年代tring and convert to signals per specified format
String Compare Compare two input strings
String Concatenate 连接输入字符串以形成一个输出字符串
String Constant Output specified string
字符串包含 确定字符串是否包含,以模式开头或结束
字符串计数 Count occurrences of pattern in string
String Find Return index of first occurrence of pattern string
String Length Output number of characters in input string
String to ASCII 将字符串信号转换为UINT8矢量
字符串为double 将字符串信号转换为双信号
字符串到枚举 Input string signal to enumerated signal
String to Single 将字符串信号转换为单个信号
Substring Extract substring from input string signal
To String Convert input signal to string signal

功能

expand all

枚举 集体枚举成员和名称
金宝appSimulink.DefineIntenumType 定义枚举数据类型
Simulink.findIntEnumType 查找由金宝appSimulink.DefineIntenumType
Simulink.clearIntEnumType Delete enumeration classes defined by金宝appSimulink.DefineIntenumType
Simulink.data.getEnumTypeInfo 获取有关枚举数据类型的信息
金宝appsimulink.da金宝appta.issupportedenumclass 确定枚举类是否有效金宝app
金宝appsimulink.da金宝appta.issupportedenumobject Determine whether an enumeration object is valid for金宝app
FIXDT Create金宝appsimulink.numerictype描述定点或浮点数据类型的对象
FIXPT_EVENSPACE_CLEANUP 修改查找表的断点甚至具有间距
fixpt_interp1 实现1D查找表
fixpt_look1_func_approx 通过插值查找表数据点来优化非线性函数的固定点近似
fixpt_look1_func_plot 绘图查找表的定点近似函数
fixpt_set_all 为子系统中的每个定点块设置属性
FIXPTBESTEXP Exponent that gives best precision for fixed-point representation of value
fixptbestprec 确定可用于定点表示值的最大精度
float Create金宝appsimulink.numerictypeobject describing floating-point data type
num2fixpt 通过指定的定点数据类型将数字转换为可表示的最近值
sfix Create金宝appsimulink.numerictypeobject describing signed fixed-point data type
SFRAC Create金宝appsimulink.numerictypeobject describing signed fractional data type
SINT Create金宝appsimulink.numerictype描述签名整数数据类型的对象
Simulink.importExternalCTypes 产生金宝app由C或C ++代码定义的自定义数据类型的表示
tunablevars2parameterobjects Create Simulink parameter objects from tunable parameters
ufix Create金宝appsimulink.numerictypeobject describing unsigned fixed-point data type
ufrac Create金宝appsimulink.numerictypeobject describing unsigned fractional data type
uint Create金宝appsimulink.numerictypeobject describing unsigned integer data type
字符串类型 Create string data type
showblockdatatypetable Display HTML page of金宝app块数据类型支持金宝app

课程

金宝appsimulink.Airstype Create alias for signal and parameter data type
金宝appsimulink.numerictype 指定浮点,整数或固定点数据类型

Simulink Configuration Parameters

话题

Validate a Floating-Point Embedded Model

Use simulation to verify that a control algorithm can continue to meet application requirements while using single-precision floating-point data types.

Control Data Types of Signals

Apply data types other thandoubleto signals in a model.

Specify Fixed-Point Data Types

If you do not have Fixed-Point Designer™, you can still inspect and use fixed-point models that others share with you.

使用数据类型助手指定数据类型

Interactively apply data types, such as integer, fixed-point, and enumerated types, to data items in a model.

在Simulink模型中使用枚举数据金宝app

在Simulink模型中创建和使用枚举。金宝app

Simulink Strings

Use strings in models.

关于数据类型in Simulink

模型中的数据项(信号,块参数和状态)具有数据类型,例如int8,这确定计算机如何代表内存中的数据。

Simulink支持的金宝app数据类型金宝app

Simulink supports many floating-point, integer, fixed-point, Boolean, and other data types.

数据类型for Buses

通过创建simulink.bus对象,为整个总线指定数据类型。金宝app总线是包含多个单个线路的数据的一条线。

金宝app模拟枚举

Enumerated data is data that is restricted to a finite set of values. Simulink models can use an enumeration as a data type.

相关信息

特色示例