MATLAB: How to copy the figure to Clipboard without UIControls in MATLAB 7.8 (R2009a)

clipboardcopyfigureMATLABpowerpoint

I have created a figure with a plot and a Push Button
figure(1)
plot(1:10)
h = uicontrol('Style', 'pushbutton', 'String', 'Push', 'Position', [120 150 100 70]);
I would like to copy this figure and paste it into another program, for example, into a PowerPoint, without the UIControl, i.e., the Push Button. I would also like to save the option to not include the UIControls when copying to Clipboard such that I do not have to change my copy options every time I open a new figure.
I have tried to uncheck the option 'Print UIControls' in the Print Preview->Advanced Tab, and then use the 'Copy Figure' from the 'Edit' menu. However, the 'Print UIControls' option from the the Print Preview does not get saved when I open a new figure.

Best Answer

There are two ways to ensure that the figure gets copied without UIControls:
1. Select Edit->Copy Options-> Figure Copy Template. Uncheck the 'Show uicontrols' option under 'Uicontrols and axes' and click 'OK'. You can then copy the figure using Edit->Copy Figure.
The preferences you have set using the ‘Copy Options’ get saved in the preferences file matlab.prf in the preferences directory. The matlab.prf file loads when you start MATLAB. When you make changes to preferences while using MATLAB, it makes the changes to matlab.prf. When you close MATLAB, it saves those changes to matlab.prf. You will need, therefore, to make changes to the 'Show uicontrols' option in the ‘Copy Options’ only once. For more information on the preferences file please refer to the documentation by executing the following in the MATLAB command prompt:
web([docroot '/techdoc/matlab_env/bq37czj-1.html#bq37czj-9'])
2. Copy the figure contents to the clipboard without UIControls programmatically using PRINT command with the '-dmeta' and '-noui' options. The following command copies the contents of the current figure to clipboard without UIControls:
print -dmeta -noui
For more information on the different options for the PRINT command, including'-dmeta' and '-noui', please refer to the documentation by executing the following in the MATLAB command prompt:
web([docroot '/techdoc/ref/print.html#f30-443485'])