'Referenced Model Block with varying inport dimensions

I am having some severe trouble ith Simulink right now. I basically use parameterized Referenced Models for easy reusing of Model Blocks inside a larger model. However I have run into a problem:

  • Model Arguments can't be used on non-tunable parameters (like inport dimensions)
  • Variable-Sizdes signals cannot simply be created by MUXing signals together. (So using variable-sized inports is also difficult.)
  • The required dimensional information sadly gets lost at the model boundary.

A few pictures to showcase my problem: enter image description here

enter image description here

enter image description here

it is easy enough to define the port dimensions inside this model. But I want this model to be reusable various dimensionalities (Maybe I want to Mux together 3 instead of 2 signals).

The math inside should be fine with any dimension and in a subsystem this should work just fine, but the model boundary makes it hard for me to create this in an easy to re-use way...

Any tips would be appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source