MATLAB: Model block cannot be under a non-trivial mask since the model it references has grouped model arguments.

model argumentsnon-trivial maskreferenced modelsimulink

Hello,
I have created a model with model arguments, which are grouped into a structure using a Simulink.Parameter object and a Simulink.Bus object as data type. The model arguments are stored in the model workspace and marked as arguments.
This model can be referenced from another model without any issues using a model reference block.
But if I mask the referenced model, I always get the following error during compilation:
Model block 'myModel' cannot be under a non-trivial mask since the model it references has grouped model arguments.
Do I miss some point regarding referenced models?
Thx for helping…

Best Answer

The issue happens if the Simulink.Parameter object has a Storage Class other than Auto. By changing it to
myParam = Simulink.Parameter(myStruct);
myParam.CoderInfo.StorageClass = 'Auto';
the model can be referenced with a mask.