Search code examples
matlabsimulink

Cannot change the dimensions of run-time parameter in Model block


I have a Simulink model with a Model block I am using to avoid duplication of some functionality.

When I try and run the parent model, I get the following errors:

  • Cannot change the dimensions of run-time parameter 'Gain' in 'TranslationChannel/First-Order Filter1/Model/Continuous/A' from [1x1] to [0x0] while model is executing
  • Invalid setting in 'TranslationChannel/Second-Order Filter/Model/Continuous/A*x/A11' for parameter 'Gain'
    • Error evaluating parameter 'Gain' in 'TranslationChannel/Second-Order Filter/Model/Continuous/A*x/A11'
      • Reference to non-existent field 'A11'.
  • Invalid setting in 'TranslationChannel/Tilt/Model/Continuous/A*x/A11' for parameter 'Gain'
    • Error evaluating parameter 'Gain' in 'TranslationChannel/Tilt/Model/Continuous/A*x/A11'
      • Reference to non-existent field 'A11'.

The sub-model is below: enter image description here

The block the error refers to is First Order Fliter 1, the parameters are which are: enter image description here

How do I resolve this error, or, is there a better way of calling the same series of blocks multiple times in a model?

The parent model is below: enter image description here

EDIT: After my discussion with Ander, I tried connecting a step source directly to the model block to eliminated any possibility of a null signal and got the same error, suggesting the problem is due to calling the second model. If anyone can assist further, that would be great.

EDIT 2: I have confirmed that data is being passed into the model. Removing the filters from the sub-model makes it work fine. The error occurs in the masked portion of the filters.


Solution

  • I have resolved this my using a library instead of a model, and putting the filter blocks into a subsystem inside the library that I then drag to my main model.

    This allows me to tune the parameters once and have it change all the blocks at once.