How to load a .mat file from the parent directory?
7 次查看(过去 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!