フィルターのクリア

What is the true syntax for export_fig in order to save in a specific folder?

7 ビュー (過去 30 日間)
BN
BN 2020 年 4 月 12 日
コメント済み: Ameer Hamza 2020 年 4 月 12 日
I read almost everywhere of 3rd party Matlab function namely export_fig (downloaded from FEX) documentation But, I don't know how I can save the exported figure in a specific folder like this address: 'F:\university\matlab\'. The documentation says: "filename - string containing the name (optionally including full or relative path) of the file the figure is to be saved as. If a path is not specified, the figure is saved in the current directory" So I did some tries but failed.
Here is my code:
export_fig('filename',num2str(k), '-dpng', '-transparent', '-r300')
I tried all of this:
export_fig('F:\university\matlab\project\filename',num2str(k), '-dpng', '-transparent', '-r300');
% and
export_fig('F:\university\matlab\project\',num2str(k), '-dpng', '-transparent', '-r300');
% and
export_fig('F:\university\matlab\project\','filename',num2str(k), '-dpng', '-transparent', '-r300');
Although I got no error and code runs successfully but it saves in the current folder not in F:\university\matlab\
Does anyone know what is the problem?
Thank you

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 12 日
編集済み: Ameer Hamza 2020 年 4 月 12 日
The complete path and filename should be one input.
export_fig(['F:\university\matlab\project\filename',num2str(k)], '-dpng', '-transparent', '-r300');
%^ bracket ^
  2 件のコメント
BN
BN 2020 年 4 月 12 日
Thanks a lot. After adding brackets it works very well.
Ameer Hamza
Ameer Hamza 2020 年 4 月 12 日
Glad to be of help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by