The ability to add a button to a mask is not available in Simulink.
To work around this issue, a parameter can be added to the mask and a checkbox can be used to display the plot. The example below demonstrates how this can be done.
A dialog parameter of type 'checkbox' controls the creation of a plot. Double-clicking on the block in the model will open the mask dialog. Checking the checkbox will create a plot.
The following code was added to the OpenFcn callback for the block:
set_param(gcb,'showPlot','off');
open_system(gcb,'mask');
This ensures the checkbox is always set to 'off' when the block is opened preventing the plot from being created if it was checked from a previous opening of the mask dialog.
Best Answer