Set multiple attributes in entity generator block

1 visualizzazione (ultimi 30 giorni)
Hello,
I am trying to build a SimEvents model from code.
I need to create multiple attributes for my entity generator block but for the add_block command I am only able to set one of them.
This is the code for my EntityGenerator creator:
add_block('built-in/entitygenerator',[sys '/eg'],'Position',pos,'TimeSource','MATLAB action', 'IntergenerationTimeAction','dt=exprnd(2);','entitytype','structured','AttributeName','Path' , 'AttributeInitialValue' ,'0' );

Risposta accettata

Krishna Akella
Krishna Akella il 19 Dic 2018
Hi Marco,
The different attribute names and their initial values are delimited by the pipe symbol. For example if you want to add two attributes called 'Path1' and 'Path2' with initial values '0' and '1', you can use the following:
add_block('built-in/entitygenerator',[sys '/eg'],'Position',pos,'TimeSource','MATLAB action', 'IntergenerationTimeAction','dt=exprnd(2);','entitytype','structured','AttributeName','Path1|Path2' , 'AttributeInitialValue' ,'0|1' );
- Krishna

Più risposte (0)

Categorie

Scopri di più su Discrete-Event Simulation 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