How to load a .mat file from the parent directory?
조회 수: 11 (최근 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!