Store generated Entity type in Workspace

조회 수: 1 (최근 30일)
Aldo Rapisarda
Aldo Rapisarda 2020년 7월 30일
답변: Abdolkarim Mohammadi 2020년 9월 4일
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.

답변 (1개)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020년 9월 4일
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.

카테고리

Help CenterFile Exchange에서 Messages에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by