フィルターのクリア

Save image to chosen folder

2 ビュー (過去 30 日間)
Maria Rasmussen
Maria Rasmussen 2018 年 6 月 5 日
コメント済み: Maria Rasmussen 2018 年 6 月 5 日
I want to be able to save a .fig to a folder of the users choosing. Right now the user can choose the name of the file, but not which folder it is saved to. Currently it is saved by diffult to curr dir. What can I do?
fignew = figure('Visible','off'); % Invisible figure
newAxes = copyobj(handles.T2img,fignew); % Copy the appropriate axes
set(newAxes,'Position',get(groot,'DefaultAxesPosition')); % The original position is copied too, so adjust it.
set(fignew,'CreateFcn','set(gcbf,''Visible'',''on'')'); % Make it visible upon loading
saveas(fignew, uiputfile());
delete(fignew);

採用された回答

Stephen23
Stephen23 2018 年 6 月 5 日
編集済み: Stephen23 2018 年 6 月 5 日
You need to get the second (path) output from uiputfile:
[useName,usePath] = uiputfile();
saveas(fignew, fullfile(usePath,useName))
  1 件のコメント
Maria Rasmussen
Maria Rasmussen 2018 年 6 月 5 日
Thank you so much! It works! I had spend so many hours trying to figure it out...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by