フィルターのクリア

How to use savefig in app-designer?

48 ビュー (過去 30 日間)
Leon
Leon 2020 年 2 月 8 日
コメント済み: Leon 2020 年 2 月 9 日
Here is how I plot my map in app-designer:
load map_use; %M N
[m n] = size(M);
for i=1:200;
M2 = [];
for j=1:m;
if M(j,3)==i;
M2=[M2;M(j,1:2)];
end
end
patch(app.mapPlot, M2(:,1), M2(:,2), [0.62,0.83,0.50]);
end;
savefig(app.mapPlot, 'AA.fig'); %Line 43
but get this error:
Error using savefig (line 43)
H must be an array of handles to valid figures
So how do I properly use savefig and openfig within app-designer?
Many thanks!

採用された回答

Cameron B
Cameron B 2020 年 2 月 9 日
編集済み: Walter Roberson 2020 年 2 月 9 日
I’d use the function created by Adam Danz found on https://www.mathworks.com/matlabcentral/answers/281318-how-can-i-save-a-figure-within-app-designer It worked well for me. You can use this and then use the saveas function to save your new figure. I suppose you can set the visibility of your new figure to ‘off’ if need be, but you’ll probably have to do that yourself.
  9 件のコメント
Adam Danz
Adam Danz 2020 年 2 月 9 日
Thanks! Feel free to leave a rating and comment on the file exchange page if you'd like.
Leon
Leon 2020 年 2 月 9 日
Just did, Adam! Thanks again for your help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by