Logsout variable class is datasetRef for long simulations
5 views (last 30 days)
Show older comments
Afternoon,
I have a set of models that I've been using to simulate a power system. Usually I aim to run fairly short scenarios (usually 30 - 100 second scenarios) as the model time step is small and there's quite a bit for it to chrun through so simulating long scenarios (more than 100 seconds) is a rarity.
When running the standard shorter scenarios a logsout variable is created in the workspace that I then undertake post processing on to calculate THD etc. when this variable is created for shorter scenarios it is of the dataset class and I can then easily interrogate this - logsout{1}.values.logged_data. However, when running longer scenarios (300 second scenarios) the logsout varible is of the datasetRef class and does not appear to provide me with any useful data that I can interrogate, just things like the time that the run was started at etc.
My question is: is there a set maximum size for a variable of the dataset class and if this size is exceeded does matlab just create a datasetRef automatically instead? If this is the case is there a way that the datasetRef can be converted into the standard dataset class that's expected for logsout or can the datasetRef be used to point the the actual logsout dataset?
0 Comments
Answers (1)
Fraser Macmillen
on 3 Sep 2020
Hello Tom
Your suspicion is correct: Simulink will automatically save log data to file and output DatasetRef if the total size of the Dataset is > 5 GB to avoid memory issues. You should find a .mat file is created and one should be able to access the data using standard commands such as getElement (see doc referenced below). If memory is not a problem one can simply load the .mat file and you'll have the dataset.
Hope this helps
Fraser
1 Comment
Fraser Macmillen
on 3 Sep 2020
Just to add - when Simulink does this it should issue a warning which explains what is happening - please raise a technical support case if this is not the case. Best Regards, Fraser
See Also
Categories
Find more on Prepare Model Inputs and Outputs 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!