save で保存先を変数指定する方法
74 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
NAKAI TAKUYA
il 25 Ott 2018
Commentato: madhan ravi
il 25 Ott 2018
name="alpha"
mkdir(name)
こうすると、現在のフォルダ内にalphaというフォルダが作成されるかと思います。
このalphaの中にsaveコマンドを使い、zeta.matを保存したいです。
通常、『save zeta』でzeta.matが現在のフォルダーに作成されるところを、alphaの中に入るようにできますか?
0 Commenti
Risposta accettata
madhan ravi
il 25 Ott 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, ...');
Più risposte (1)
Vedere anche
Categorie
Scopri di più su ワークスペース変数と MAT ファイル in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!