Logsout variable class is datasetRef for long simulations
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Fraser Macmillen
2020-9-3
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 个评论
Fraser Macmillen
2020-9-3
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!