Export part of Matlab app as Image

9 ビュー (過去 30 日間)
MoSo395
MoSo395 2022 年 10 月 31 日
コメント済み: MoSo395 2022 年 11 月 7 日
Hi everyone :)
Is it possible to export a part of a matlab app as an image? I was working with exportapp(app.UIFigure, app.EditField.Value) wich worked fine to export the whole app, but I want to export only parts of it... Is there an easy way?

採用された回答

Kevin Holly
Kevin Holly 2022 年 10 月 31 日
You can try
Img = getframe(app.UIFigure)
Img = Img.cdata
imwrite(Img,'filename.png')
or
Img = getframe(app.UIAxes)
Img = Img.cdata
imwrite(Img,'filename.png')
If you want a segment of image, you can specific it based on pixels:
imwrite(Img(1:50,end-50:end,:),'filename.png')
  1 件のコメント
MoSo395
MoSo395 2022 年 11 月 7 日
Thank You :) it worked

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by