主要内容

数据存储

R2026b
为模型不同级别的多个信号定义全局值

较大的模型可能需要将各个信号发送给图中不同位置的多个单独模块。您可以配置一个数据存储,以允许从模型中的任何位置访问信号数据,类似于计算机程序中的全局变量。但是,与全局变量类似,数据存储可能会降低模型的透明度,使模型验证更加困难。要决定是否使用数据存储,请参阅数据存储基础知识。

要在较大模型中传送信号,可以考虑使用 Goto 和 From 模块,而不是数据存储。

模块

Data Store Memory blockData Store Memory定义数据存储
Data Store Read blockData Store Read从数据存储中读取数据
Data Store Write blockData Store Write向数据存储中写入数据

类

Simulink.SimulationData.DataStoreMemoryContainer for data store logging information
Simulink.SimulationData.BlockPathFully specified block path
Simulink.SimulationData.Dataset访问记录的仿真数据或对仿真输入数据分组

对象

Simulink.DataStoreSpecify instance-specific properties of data store (自 R2026b 起)

模型设置

全部展开

检测写前读Diagnostic action to take if model reads from data store before writing to that data store in current time step
检测读后写Diagnostic action to take if model writes to data store after reading from data store in current time step
检测写后写Diagnostic action to take if model writes to data store twice in current time step
多任务数据存储Diagnostic action to take when task reads from data store to which another task writes
重复数据存储名称Diagnostic action to take if model contains multiple data stores with same name

主题

精选示例