How to visualize a "timetable" variable in the Simulation Data Inspector without having to manually import it at the end of the simulation?
3 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2023-8-6
回答: MathWorks Support Team
2023-9-15
In MATLAB R2023a, I have created a "timetable" variable using a script. I would like to visualize this variable in the Simulation Data Inspector for my Simulink model, without having to import it manually each time I run the simulation.
How can I do that automatically?
采纳的回答
MathWorks Support Team
2023-8-6
In order to visualize a "timetable" object in the Simulation Data Inspector without having to manually import it, you can follow these steps:
1. Import the "timetable" variable from the MATLAB base workspace using a "Playback" block.
For more information on the "Playback" block, you can refer to the following link:
https://www.mathworks.com/help/releases/R2023a/simulink/slref/playback.html
2. Add a "Scope" block and connect the outputs of the "Playback" block.
For more information on the "Scope" block, you can refer to the following link:
https://www.mathworks.com/help/releases/R2023a/simulink/slref/scope.html
3. Double-click on the "Scope" block, then select
View > Configuration Properties > Logging
. Tick the option "Log data to workspace", then click "Apply" and "OK".
4. In the "Modelling" tab select
Model Settings > Data Import/Export
. Tick the option "Record logged workspace data in Simulation Data Inspector", then click "Apply" and "OK".
For more information on the "Record logged workspace data in Simulation Data Inspector", you can refer to the following link:
https://www.mathworks.com/help/releases/R2023a/simulink/gui/recordloggedworkspacedatainsimulationdatainspector.html
5. Run the simulation and open the Simulation Data Inspector from the "Simulation" tab. You should be able to visualize the data logged from the "Scope" block.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Load Signal Data for Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!