フィルターのクリア

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

74 ビュー (過去 30 日間)
NAKAI TAKUYA
NAKAI TAKUYA 2018 年 10 月 25 日
コメント済み: madhan ravi 2018 年 10 月 25 日
name="alpha"
mkdir(name)
こうすると、現在のフォルダ内にalphaというフォルダが作成されるかと思います。
このalphaの中にsaveコマンドを使い、zeta.matを保存したいです。
通常、『save zeta』でzeta.matが現在のフォルダーに作成されるところを、alphaの中に入るようにできますか?

採用された回答

madhan ravi
madhan ravi 2018 年 10 月 25 日
%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 件のコメント
madhan ravi
madhan ravi 2018 年 10 月 25 日
the above shows an example

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

その他の回答 (1 件)

NAKAI TAKUYA
NAKAI TAKUYA 2018 年 10 月 25 日
Thank you!!
  1 件のコメント
madhan ravi
madhan ravi 2018 年 10 月 25 日
Anytime :)

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

カテゴリ

Help Center および File Exchangeワークスペース変数と MAT ファイル についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!