Parameter arguments for MATLAB Function blocks do not take their values from signals in the Simulink® model. Instead, Simulink searches up the workspace hierarchy. Simulink first looks in a masked workspace if the MATLAB Function block or a parent subsystem is masked. If the value is not found, it next looks in the model workspace and then the MATLAB® base workspace.
You can provide a custom interface for parameters by masking the MATLAB Function block. Creating a mask for a block allows you to define the access for each parameter. See Masking for more information.
In the MATLAB Function Block Editor, add an argument to the function header of the MATLAB Function block. The name of the argument must match the name of the masked parameter or MATLAB variable that you want to pass to the MATLAB Function block.
The new argument appears as an input port on the MATLAB Function block in the model.
The input port for the parameter argument no longer appears in the MATLAB Function block.
For information on declaring parameters for masked blocks, see How Mask Parameters Work.