MATLAB: How to use a Simulink.Signal Object as a parameter in a masked subsystem in R2017a


I have a masked subsystem and I want one of the parameters to be a Simulink.Signal object but I keep getting an error stating that "Signal objects should only be created in the base workspace, data dictionary, or model workspace" 

Best Answer

This functionality is not supported at this time, however a workaround is to pass the Simulink.Signal object variable name as a string to the masked parameter.  Now, this parameter cannot be directly used to set the parameter of a block in the system that requires a signal object because it is a string.  To set block parameters in the subsystem using this mask parameter, I recommend using the Initialization callback with 'set_param' to set the corresponding block parameters from the mask.