MATLAB: How to hide initialize, reset, or terminate ports after creating a Test Harness

harnessinitialiseinitializemodelportsresetsimulink testterminatetest

When creating a Test Harness I sometimes forget to untick the option "Enable initialize, reset, and terminate ports"; this causes the following error when I try to run my Test Harness:
Error executing function-call at the model terminate port of Model block '< PathToBlock >' at time X.X. The Model block must be initialized via the model initialize port before any function-call can be executed. You can choose to hide the model initialize port to allow Simulink to handle the model initialize event automatically.
How can I hide these ports after Test Harness creation?

Best Answer

To hide these ports after test harness creation, you can use the following commands:
>> set_param( < Subsystem Name > , 'ShowModelInitializePort', 'off');
>> set_param( < Subsystem Name > , 'ShowModelResetPorts', 'off');
>> set_param( < Subsystem Name > , 'ShowModelTerminatePort', 'off');