Store generated Entity type in Workspace

1 visualizzazione (ultimi 30 giorni)
Aldo Rapisarda
Aldo Rapisarda il 30 Lug 2020
Hello! I'm having some trouble with my simulink model: I have an entity generator that creates 3 different type of entity at each generation step (let's consider them as product 1,2,3 and so the entity type are 1, 2, 3).
Now, I would like to trace in the Workspace which is the type of entity that is generated in a specific point in time.
My output store correctly the intergeneration time (At start) and the Time in system, but I would like to add also which type of attribute is generated.
How can I solve this Issue?
Thanks, Aldo.

Risposte (1)

Abdolkarim Mohammadi
Abdolkarim Mohammadi il 4 Set 2020
You need a Simulink function, whose output port is connected to a "To workspace" block. Let's call this function RecordGenerationTime().
You also need a function to get the simulation time. This function contains a Digital clock block. Let's call this function GetSimulationTime().
In the Entry event action for all of the generators, you first get the current simulation time, and then record it:
CurrentSimulationTime = GetSimulationTime();
RecordGenerationTime(CurrentSimulationTime);
When Simulink is done executing the model, you can see the results in the structure created in the base workspace, which contains a timeseries object that contains the exact records for the generation times.

Categorie

Scopri di più su Messages in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by