MATLAB: How to selectively hide parameters from the block dialog for a custom Simscape component

parametricSimscapevariability

I have developed a Simscape component with a lookup table, with help from the following documentation:
The Simscape component has three parameters:
 
parameters
Param1 = {<values>, 'units'};
Param2 = {<values>, 'units'};
Param3 = {<values>, 'units'};
end
I would like to make parameters 'Param1' and 'Param3' not accessible to the user. So I attempt to move these definitions to the private variables section. However, when I attempt to build the component, I see the following error:
  ERROR: Failed to generate '<LibName>' Caused by: Error using ne_buildpackage>@()validate(feval(libHelpers{idx}.Command)) Expression is not of expected variability: parametric.
Is there a way to make some parameters private?
 

Best Answer

You should be able to control parameter access by using two different parameter sections, one for the visible parameters and a second for the private ones specified with "(Access=private)".
For example, the parameter sections on your custom Simscape component  could look similar to the following code snippet:
 
parameters
Param2 = {<values>, 'units'};
end
parameters (Access = private)
Param1 = {<values>, 'units'};
Param3 = {<values>, 'units'};
end
This is shown as an example in the Case Sensitivity section of the following documentation: