saveas(gcf​,save_name​+".png")をフ​ォルダを指定して保存

saveas(gcf,save_name+".png");を決まったフォルダに保存するためにはどのようにすればよろしいでしょうか。

 Réponse acceptée

Kojiro Saito
Kojiro Saito le 21 Juil 2023

3 votes

saveasの第2引数に「フォルダー名\」 (Windowsの場合)、「フォルダー名/」(LinuxとMacの場合)を入れるか、fullfileでフォルダー名入りのパスを作ればできます。
例えば現在のフォルダーの中にあるresultというフォルダーに入れたい場合、
saveas(gcf, fullfile("result", save_name+".png"));
または
saveas(gcf, "result\" + save_name+".png");
でできます。
フルパスを指定することもできます。
saveas(gcf, "C:\Result\" + save_name+".png");

1 commentaire

晃平
晃平 le 8 Fév 2024
ご回答ありがとうございました。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur コマンドの入力 dans Centre d'aide et File Exchange

Produits

Version

R2021a

Tags

Community Treasure Hunt

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

Start Hunting!