The answer from the MATLAB support:
>> maskObj = Simulink.Mask.get('Example/subsystem'); >> tab = maskObj.getDialogControl('Container4'); >> tab.removeDialogControl('Control2') Where the "Container4" and "Control2" are the Names for the Tab and the Button.
The reason that you receive this error is because that in MATLAB R2014b the function "removeDialogControl" does not return any output. Therefore, assigning it to a variable "p" will cause the error.