Effacer les filtres
Effacer les filtres

save で保存先を変数指定する方法

74 vues (au cours des 30 derniers jours)
NAKAI TAKUYA
NAKAI TAKUYA le 25 Oct 2018
Commenté : madhan ravi le 25 Oct 2018
name="alpha"
mkdir(name)
こうすると、現在のフォルダ内にalphaというフォルダが作成されるかと思います。
このalphaの中にsaveコマンドを使い、zeta.matを保存したいです。
通常、『save zeta』でzeta.matが現在のフォルダーに作成されるところを、alphaの中に入るようにできますか?

Réponse acceptée

madhan ravi
madhan ravi le 25 Oct 2018
%get the directory of your input files:
pathname = fileparts('/input/file');
%use that when you save
matfile = fullfile(pathname, 'output.mat');
figfile = fullfile(pathname, 'output.fig');
save(matfile, ...');
saveas(figfile, ...');
  1 commentaire
madhan ravi
madhan ravi le 25 Oct 2018
the above shows an example

Connectez-vous pour commenter.

Plus de réponses (1)

NAKAI TAKUYA
NAKAI TAKUYA le 25 Oct 2018
Thank you!!
  1 commentaire
madhan ravi
madhan ravi le 25 Oct 2018
Anytime :)

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!