MATLAB: How do you read an attribute from one part of a composite entity

SimEventssimevents entity composite attribute

I have two entities that create a new composite entity. After that creation I will need to access an attribute from one of these entities in the composite entity. How do I do that?

Best Answer

Composite entities retain the hierarchical structure of the constituent entities. There are two ways:
(1) Directly method. If you name your constituent entities E1 and E2, you can access the original attributes by using entity.E1.Attribute.
(2) Indirect method. You can first split the composite entity and read their attributes separately. I have implemented both methods in the attached model.