I have a masked model (let's call it sensor_mdl). Parameters were created in the model workspace as Matlab variables, and set as Arguments. The parameters in the mask refer to the corresponding parameters in the model workspace.
I added this model as a referenced model in another model, called sensor_top, which can contain one or more instances of sensor_mdl.
I am trying to update programmatically the values used for sensor_mdl in sensor_top.
I use the commands:
objMask = Simulink.Mask.get('sensor_top/Model');
objMaskParameters = objMask.Parameters;
parameter1 = objMaskParameters(1);
But I get the error message:
"Unable to modify the mask of block 'MTM_top/Model'. Modify the referenced model's mask definition instead."
Any idea why and how to fix this?