How to load a .mat file from the parent directory?
6 ビュー (過去 30 日間)
古いコメントを表示
How to load a file which is in the parent directory of the running script?
0 件のコメント
採用された回答
Joseph Cheng
2015 年 5 月 19 日
編集済み: Joseph Cheng
2015 年 5 月 19 日
you can determine your current directory with pwd.
so to load the file it'll go something like this
myfile = 'mymatfile.mat';
[parentdir,~,~]=fileparts(pwd);
load(fullfile(parentdir,myfile))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!