数据记录
在模型仿真期间将数据记录到工作区,以便用于后续数据处理
您可以将仿真数据记录到工作区或磁盘上的临时文件中,以便进行调试和校验。使用数据记录,您可以分析仿真过程中内部模块变量如何随时间变化。如果记录仿真数据,之后您可以查询、绘制和分析这些数据,而无需重新运行仿真。您可以使用 Simscape™ 数据记录和选择性记录插桩来记录模块变量数据。
Simscape 数据记录可记录模型中选定模块或所有模块的所有变量,并将数据输出到仿真日志工作区变量。您可以使用 Simscape 结果浏览器工具以交互方式可视化和导航 Simscape 数据记录结果。您可以使用数据记录和 Simscape 结果浏览器来查看仿真结果,而无需向模型添加传感器和示波器。要了解详细信息,请参阅Log, Navigate, and Plot Simulation Data。
选择性记录仅会记录启用了记录功能的模块上的选定变量。Simscape 会将变量与 Simulink® 信号一起记录到 Simulink.SimulationData.Dataset
对象中。您可以通过用户界面为 Simscape 模块启用选择性记录。您可以在“插桩表”中查看并选择用于记录的模块变量,而无需编译模型。要可视化选择性记录结果,请使用仿真数据检查器。要了解详细信息,请参阅Log Selected Block Variables。
您还可以通过编程方式管理选择性记录插桩。要了解详细信息,请参阅Log Selected Variables Programmatically。
工具
Simscape 结果浏览器 | Navigate and plot simulation data logging results |
函数
主题
Simscape 数据记录
- About Simscape Data Logging
You can log Simscape simulation data to the workspace, or to a temporary file on disk, for debugging and verification. - Enable Simscape Data Logging for the Whole Model
Using data logging for the whole model is a best practice. - Log Data for Selected Blocks Only
Instead of logging Simscape simulation data for the whole model, you can log data just for the selected blocks. - Data Logging Options
Additional options for logging and displaying the simulation data. - Stream Logging Data to Disk
When you log simulation data, you can stream the data to a temporary file on disk and have the workspace variable point to that temporary file. - Saving and Retrieving Logged Simulation Data
Methods of storing logged simulation data for future use and retrieving it at a later time. - Log, Navigate, and Plot Simulation Data
This example shows the basic workflow for logging simulation data for the whole model and then navigating and plotting the logged data using Simscape Results Explorer. - Log and Plot Simulation Data
This example shows how you can log and plot simulation data instead of adding sensors to your model. - Log Simulation Statistics
This example shows how you can access and analyze information on zero crossings during simulation. - Log and View Simulation Data for Selected Blocks
This example shows how you can set your model to log simulation data for selected blocks only and how to view simulation data using Simscape Results Explorer. - Plot Simulation Data in Different Units
When you display logged simulation data in Simscape Results Explorer, you can change they
-axis units directly on the plot. - Use Custom Units to Plot Simulation Data
This example shows how you can change to a custom unit display of logged simulation data. - Indexing into Component Arrays
You can use command-line interface to index into an array of components, for example, to get or set operating point targets for a particular array member, or to plot simulation data.
选择性记录
- About Selective Logging
You can output data for selected Simscape block variables along with Simulink variables and signals. - Log Selected Block Variables
Log data for an individual block variable. - Log Selected Variables Programmatically
Programmatically configure selective logging.