Saving a figure to a specific location

71 ビュー (過去 30 日間)
Jonathan Moorman
Jonathan Moorman 2020 年 9 月 10 日
コメント済み: Jonathan Moorman 2020 年 9 月 10 日
Hello! I am using app designer and am trying to save a figure named app.UIAxes as a JPEG to this file location C:\Users\jmoor\OneDrive\Documents\MATLAB\FigureExport. I understand there is probably a fairly straight forward solution, but I have been struggling to create some code without any errors. Any help would be much appreciated!

回答 (1 件)

KSSV
KSSV 2020 年 9 月 10 日
fpath = 'C:\Users\jmoor\OneDrive\Documents\MATLAB\FigureExport';
filename = 'test' ;
saveas(gca, fullfile(fname, filename), 'jpeg');
  1 件のコメント
Jonathan Moorman
Jonathan Moorman 2020 年 9 月 10 日
I have two questions. Where do we use fpath in the code, and what if I wanted to save multiple files such as app.UIAxes, app.UIAxes2, and app.UIAxes3. Therefore, we wouldn't be able to use gca.

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

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by