Store generated Entity type in Workspace

1 visualización (últimos 30 días)
Aldo Rapisarda
Aldo Rapisarda el 30 de Jul. de 2020
Respondida: Abdolkarim Mohammadi el 4 de Sept. de 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.

Respuestas (1)

Abdolkarim Mohammadi
Abdolkarim Mohammadi el 4 de Sept. de 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.

Categorías

Más información sobre Messages en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by