How to Retreive All Time Data
3 次查看(过去 30 天)
显示 更早的评论
When I run my simulink model, I generate a table in the workspace in a script that is run after simulation. This script gets the time from the output of the simulation as Time=out.tout. I can also get the data by exporting it from the simulation data inspector. When I use the simulation data inspector I get more time points that I do when I use the out.tout data method.
I would like to get the data in the simulation output to use when I generate the table in the workspace as it has more data of interest on and around some step changes in the simulation. How do I get non-truncated data without saving from the simulation data inspector? I would like to automate this and get it in workspace as the simulation will run many times and I use the workspace table to generate charts for each trial run.
2 个评论
Mathieu NOE
2024-4-26
hello
when you say "out.tout data method" you mean you have a "To Workspace" block (or something equivalent)
double check in the options window that you are not limited to a certain amount of samples , other wise you may retrieve only the last N samples (if the limit is set to N)
回答(1 个)
Samay Sagar
2024-8-29
Hi Dieter,
To store a more detailed set of simulation time in the MATLAB workspace, similar to what you see in the Simulation Data Inspector (SDI), you can adjust the simulation data logging settings.
Here is how you can enable data logging for all solver steps:
- Open your Simulink model.
- Go to Model Configuration Parameters by using the menu “Simulation > Model Configuration Parameters”.
- Navigate to “Data Import/Export”.
- In the “Save to workspace” section, ensure that the “Time” and “Output” option is checked.
- Change the Save options setting to All data points to log data at all solver steps
- You can choose the data storage format based on your need
- Check the “Additional Parameters” to ensure that data logging is not limited to some fixed points
If you are storing the output as dataset, you can access output data as follows:
outputData = simOutout.yout{1}.Values.Data
Assuming that “simOut” is the name of the output dataset in the workspace.
You can also enable “Signal Logging” to capture specific signals at all solver steps.
For more information about Simulink data logging and format of logged data, you can refer the following documentation: https://www.mathworks.com/help/releases/R2024a/simulink/ug/export-simulation-data-1.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!