simulink logsout empty dataset

39 次查看(过去 30 天)
Dorian Hargarten
Dorian Hargarten 2018-7-13
评论: Peter Savage 2024-9-19,9:29
Hello everybody,
has anybody else encountered an issue with Simulink in the R2018a release, where the logsout dataset is sometimes empty, even when the model hasn't been changed and rerunning the same simulation input object produces a complete dataset? This issue is very frustrating, and not well reproducible, as it happens sometime, but not everytime. Here's what I'm trying to do:
I have a Simulink Model, from which I generate a vector of input objects
in(1:10)=Simulink.SimulationInput(mdl);
I then modify these with different initial conditions by setting some block parameters, and then run them as a batch job (no parallelization):
out=sim(in);
Because I have selected various signals to be logged, I get a logsout dataset for each simulation run. In the postprocessing, I step through each output object out(i) and plot some results from the logsout datasets. Sometimes, some of the datasets are empty, meaning
out(i).logsout.numElements
returns zero. When I manually rerun the simulation with the respective initial condition, everything works fine. Any ideas?
Thanks for your help!
  3 个评论
Peter Savage
Peter Savage 2024-9-17,13:27
编辑:Peter Savage 2024-9-17,13:31
Hi, I come from the future, this bug still exists in version 2024a.
I am running many iterations of a simulink model through PARSIM. Sometimes inexplicably the
out(1, jj).yout{1}.Values.Data(1,1,end)
dataset is empty. When rerunning with the same initial conditions it runs fine and is not empty. This is proving very annoying because I am using it in a test harness scenario and I don't know if the system under test has failed or the MATLAB function has failed.
I am going to attempt to automatically rerun the tests that fail and hopefully they will end successfully.
Peter Savage
Peter Savage 2024-9-19,9:29
Note: in relation to my PARSIM situation, PARSIM appears to use data dictionaries from the saved file rather than unsaved changes that would be used by the direct run from simulink.

请先登录,再进行评论。

回答(1 个)

Jayanti
Jayanti 2024-9-18,9:03
There are chances that when you compile a model, it resets the base workspace, which can sometimes affect the logging of signals, resulting in empty “logsout” value.
To address this, you can use the "Single Simulation Output" flag. By enabling this option, you can ensure that the associated simulation output variable is not reset during the compilation process.
To enable “Single Simulation Output” flag in your Simulink model
Go to Configuration Parameters -> Data Import/Export section ->Enable "Single Simulation Output" option.
This will consolidate all the simulation outputs into a single object.

类别

Help CenterFile Exchange 中查找有关 Outputs 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by