MATLAB Answers

Simulink: How to export to workspace all entities attributes?

4 views (last 30 days)
Matias Giardino
Matias Giardino on 27 May 2018
Answered: Krishna Akella on 4 Dec 2018
I have assigned 7 different attributes to each entity (mainly time stamps as the entity moves along the process). How can I export to workspace a variable containing a matrix with all the attributes (columns) for each entity (rows) ?
  2 Comments
Matias Giardino
Matias Giardino on 28 May 2018
Hi, I'm using simevents. Entities are created using the entities generator module. Thanks.

Sign in to comment.

Answers (1)

Krishna Akella
Krishna Akella on 4 Dec 2018
Hi Matias,
Have you tried using the assignin function? For example, in the event actions of any SimEvents block, try calling:
coder.extrinsic('assignin');
assignin('base', 'k', entity)
Assuming, k is the variable in your workspace that you want to assign the values of the entity to.
- Krishna

Community Treasure Hunt

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

Start Hunting!

Translated by