Assign Attribute From Matlab Workspace

1 Ansicht (letzte 30 Tage)
Jeff Bradley
Jeff Bradley am 12 Jun. 2011
I have a 2-D array that is created in Matlab that I want to increment through and assign as 1-D vectors to a sequence of entities.
  4 Kommentare
Jeff Bradley
Jeff Bradley am 13 Jun. 2011
The entities are are Time-Based, representing an Interlaken Data Word. The attribute is the 67 bits of data constitute the word.
Jeff Bradley
Jeff Bradley am 13 Jun. 2011
Good question Paulo. The question is how do I go about getting the attribute, that exists in Matlab, associated with the entity?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Devdatt Lad
Devdatt Lad am 13 Jun. 2011
Use the statistic Number of entities departed, #d from the time-based entity generator block and feed it to a Discrete Event Subsystem which contains a Constant block followed by a Selector block. Set the constant value to be the workspace variable, and feed the #d signal as the index port of the selector block. Thus, for the i-th entity, the selector will output Constant[i]. Use the Set Attribute block at the output of the Discrete-Event Subsystem to set this value as the entity's attribute. Is this what you are looking for?
Remember to use a single server with service time 0, between the time-based entity generator and the set attribute block to get the timing right. More on that here.
  1 Kommentar
Jeff Bradley
Jeff Bradley am 13 Jun. 2011
Thanks Lad. You have confirmed that I'm on the right path. I will be trying Dis Ev Subsystem approach thia afternoon. You just brought my confidence up significantly. :-)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 13 Jun. 2011
Please see the third row of the table in the user guide
  1 Kommentar
Jeff Bradley
Jeff Bradley am 13 Jun. 2011
Thanks Walter.
I've been down that path. The problem I'm having is, based on the entity number, I want to grab a specific row from the array of data and associate with the entity. In other words, when I have an entity in the SimEvents domain I would like to use that entity to request data from the Matlab domain and associate it with the enity.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete-Event Simulation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by