Is it possible to generate new attributes not in entity generator but in servers in SimEvents?

1 回表示 (過去 30 日間)
Ho Jung Kim
Ho Jung Kim 2022 年 7 月 21 日
回答済み: Pratyush 2023 年 10 月 27 日
I am trying to add new attributes to the entity not in entity generator but after the entity is generated. Is it possible to add new attributes to the entity outside of entity generator? Is it also possible to delete attributes from entity?

回答 (1 件)

Pratyush
Pratyush 2023 年 10 月 27 日
Hi Ho,
I understand that you want to add or delete attributes to an entity after the entity is created.
You can use dynamic properties to achieve this. You can inherit "dynamicprops" class to add properties after instance creation. You can refer to this documentation for more details: https://in.mathworks.com/help/matlab/matlab_oop/dynamic-properties-adding-properties-to-an-instance.html
To remove an attribute you can use "rmfield" function. Note that it can remove dynamic property from geographic or planar vector only. You can refer to the following documentation for more details: https://in.mathworks.com/help/map/ref/geopoint.rmfield.html

カテゴリ

Help Center および File ExchangeSimEvents についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by