MATLAB: How to copy a figure to the clipboard from a stand-alone application generated with the MATLAB Compiler

aloneMATLAB Compilerprintstand

I would like to copy and paste a figure from a stand-alone application, but all of the usual figure menu options, like edit, view, and insert, are not available.

Best Answer

Below is an example on how to copy a figure from a stand-alone application:
function printexample
figure;
surf(peaks);
h = uimenu(gcf, 'Label', 'Edit');
uimenu(h, 'Label', 'Copy', 'Callback', {@localprint});
function localprint(gcbo, eventdata)
print(gcf, '-dmeta');
If you get warnings about get_param not being implemented in stand alone mode, you can safely ignore these warnings.