保存仿真的运行时数据
保存仿真数据,如输出、信号、时间、状态和数据存储记录数据
在仿真期间,您可以将仿真数据保存到 MATLAB® 工作区或文件中,包括 MLDATX 文件、MAT 文件或 Excel® 文件,以便以后检索和后处理。仿真数据可以是输出、信号、时间、状态和数据存储记录数据的任意组合。
Dataset
格式为各种记录方法所记录的结果提供了一种通用的格式,因此以这种方式保存仿真数据可以简化后期处理。可以使用 Dataset
格式将数据存储为 MATLAB timeseries
或 timetable
对象,以便使用 MATLAB 进行处理。
要确定应该使用哪种方法来记录数据,请参阅保存仿真数据。
模块
Outport | 为子系统或外部输出创建输出端口 |
Record, XY Graph | Log data to the workspace, to a file, or both (自 R2021a 起) |
To File | 将数据写入到文件 |
To Workspace | 将数据从 Simulink 模型记录到工作区 |
工具
插桩属性 | View and edit logging and visualization properties for logged signal |
信号属性 | View and edit signal properties |
仿真数据检查器 | 检查并比较数据和仿真结果,以验证和迭代模型设计 |
Simulink 信号记录选择器 | View signal logging configuration and override signal logging settings |
函数
对象
模型设置
主题
仿真数据
- 保存仿真数据
保存用于分析和调试模型的仿真数据。 - View and Access Logged Simulation Data
View and access saved simulation data for a completed or paused simulation. - 记录的仿真数据的数据格式
您可以使用许多格式来记录数据,包括Dataset
、MATLABtimeseries
、数组和结构体。支持的数据格式因记录方法而异。但是,Dataset
格式可用于所有记录方法。 - 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. - 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. - 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.
信号记录
- 使用信号记录保存信号数据
通过标记要在模型中记录的信号,从仿真中捕获信号数据。 - Override Signal Logging Settings
For a specific simulation run, override the signal logging settings for individual signals marked for logging. - View the Signal Logging Configuration
View the signals that are marked for signal logging. - 查看和访问信号记录数据
查看和访问完成或暂停的仿真的信号记录数据。
大数据
- 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. - Analyze Big Data from a Simulation
Access simulation data logged to persistent storage for analysis in MATLAB.
仿真状态
- 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.
数据存储
- Log Data Stores
Configure a data store for logging so that you can view the data stored in a simulation run.