I am representing a certain robot using a Simulink model which contains Matlab function blocks, integrator blocks, etc., and intend to use this model in a main model. In the main model, I need to have multiple instances of the robot model to represent multiple robots interacting. I have found out that this is possible using referenced models.
However, each of these robots is different. Within each robot model, the architecture does not change, but the contents of the blocks do change to represent the different robots. These changes are not only parameters, but also the contents of the Matlab functions themselves. I generate these functions at the beginning of the simulation using initFcn callback, but I am unaware of how I can update the contents of each referenced model according to the generated functions.
Apologies if the question is confusing, it is not a trivial problem. Thank you in advance for the help!