在模型中,数据类型确定信号和块参数之间的交互。数字数据类型确定计算机如何将信号和参数存储在内存中以及计算机如何执行数学操作。其他模拟金宝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。
您可以使用字符串类型轻松使用型号中的字符串。
金宝appsimulink.Airstype |
Create alias for signal and parameter data type |
金宝appsimulink.numerictype |
指定浮点,整数或固定点数据类型 |
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.
Apply data types other thandouble
to 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
Use strings in models.
模型中的数据项(信号,块参数和状态)具有数据类型,例如int8
,这确定计算机如何代表内存中的数据。
Simulink supports many floating-point, integer, fixed-point, Boolean, and other data types.
通过创建simulink.bus对象,为整个总线指定数据类型。金宝app总线是包含多个单个线路的数据的一条线。
Enumerated data is data that is restricted to a finite set of values. Simulink models can use an enumeration as a data type.