保存仿真的运行时数据
将仿真数据保存到 MATLAB® 工作区;记录信号;导出信号、时间、输出和状态数据
您可以在仿真过程中将信号值保存到 MATLAB 工作区,或保存到 MLDATX 文件、MAT 文件或 Excel®,以便于以后进行检索和后期处理。保存仿真数据也称为记录或导出仿真数据。
Dataset
格式为各种记录方法所记录的结果提供了一种通用的格式,因此以这种方式保存仿真数据可以简化后期处理。可以使用 Dataset
格式将数据存储为 MATLAB timeseries
对象,以便使用 MATLAB 进行处理。
信号记录和数据存储使用
Dataset
格式。输出和状态记录使用
Dataset
作为默认格式。To File 和 To Workspace 模块的默认保存格式为
Timeseries
。
Simulink® 提供了转换工具,可以将记录的数据转换为 Dataset
格式。
要确定应该使用哪种方法来记录信号数据,请参阅导出仿真数据。
模块
Outport | 为子系统或外部输出创建输出端口 |
Record, XY Graph | Log data to the workspace, to a file, or both |
To File | 将数据写入到文件 |
To Workspace | 将数据从 Simulink 模型记录到工作区 |
工具
函数
对象
模型设置
主题
仿真数据
- 导出仿真数据
导出(记录)仿真数据作为分析和调试模型的基准。 - 记录的仿真数据的数据格式
您可以使用许多格式来记录数据,包括Dataset
、MATLABtimeseries
、数组和结构体。支持的数据格式因记录方法而异。但是,Dataset
格式可用于所有记录方法。 - Convert Data to Dataset Format
To convert a workspace variable that contains data that was logged in a format other thanDataset
format to useDataset
format, use aSimulink.SimulationData.Dataset
constructor. - Work with Big Data for Simulations
Log, load, and analyze big data for simulations. - Limit the Size of Logged Data
Choose among several strategies to limit the size of logged data. - Specify Signal Values to Log
Specify which signal values to log during simulation. - Log Data to Persistent Storage
Store logged simulation data to persistent storage in a MAT-file. - Load Big Data for Simulations
Load big data as simulation input. - Analyze Big Data from a Simulation
Access simulation data logged to persistent storage for analysis in MATLAB. - Samples to Export for Variable-Step Solvers
Control how much output the simulation generates when your model uses a variable-step solver. Use the Output options configuration parameter. - Log Data to the Workspace and a File Using the Record Block
Use the Record block to log data to the workspace, to a file, or to both the workspace and a file.
仿真状态
- Save Block States and Simulation Operating Points
Learn how you can use state information logged from simulation and decide how to log states and operating points. - Save State Information
Save state information for logged states for each simulation step during a simulation.
信号记录
- 使用信号记录导出信号数据
要从仿真中捕获信号数据,可以使用信号记录。标记要记录的信号,并为模型启用信号记录。 - 配置信号记录
标记您要记录仿真数据的信号。 - View the Signal Logging Configuration
View the signals that are marked for signal logging. - 为模型启用信号记录
要记录标记的信号,请设置“信号记录”配置参数。 - Override Signal Logging Settings
For a specific simulation run, override the signal logging settings for individual signals marked for logging. - 查看和访问信号记录数据
查看和访问完成或暂停的仿真的信号记录数据。 - Convert timeseries object to Dataset object
- Log Signals in For-Each Subsystems
Use signal logging in For Each subsystems.
数据存储
- Log Data Stores
Configure a data store for logging so that you can view the data stored in a simulation run.