How do I copy a figure to the clipboard from a stand-alone application generated with the MATLAB Compiler in MATLAB R2022a?
4 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Edited: MathWorks Support Team
on 14 Feb 2025
I would like to copy and paste a figure from a stand-alone application generated from MATLAB Compiler in MATLAB R2022a, but all of the usual figure menu options like edit, view, and insert, are not available. How can I do this?
Accepted Answer
MathWorks Support Team
on 12 Feb 2025
Edited: MathWorks Support Team
on 14 Feb 2025
Below is an example on how to copy a figure from a stand-alone application. This code creates a new "uimenu" object called "Edit", which will now appear on the figure's toolstrip when the compiled application is run. Then, it gives this "uimenu" object a dropdown option that you can select called "Copy". Clicking on this option will copy the figure to your clipboard.
figure;
plot(1:10, 1:10);
h = uimenu(gcf, 'Label', 'Edit');
uimenu(h, 'Label', 'Copy', 'Callback', {@localprint});
function localprint(gcbo, eventdata)
print('-clipboard','-dmeta')
end
If you get warnings about get_param not being implemented in stand alone mode, you can safely ignore these warnings.
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!