How to visualize a "timetable" variable in the Simulation Data Inspector without having to manually import it at the end of the simulation?
6 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Aug 2023
Answered: MathWorks Support Team
on 15 Sep 2023
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?
Accepted Answer
MathWorks Support Team
on 6 Aug 2023
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 Comments
More Answers (0)
See Also
Categories
Find more on Load Signal Data for Simulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!