How do I copy a figure to the clipboard from a stand-alone application generated with the MATLAB Compiler in MATLAB R2022a?
조회 수: 4 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2009년 6월 27일
편집: MathWorks Support Team
2025년 2월 14일
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?
채택된 답변
MathWorks Support Team
2025년 2월 12일
편집: MathWorks Support Team
2025년 2월 14일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!