How to load a .mat file from the parent directory?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mr M.
el 19 de Mayo de 2015
How to load a file which is in the parent directory of the running script?
0 comentarios
Respuesta aceptada
Joseph Cheng
el 19 de Mayo de 2015
Editada: Joseph Cheng
el 19 de Mayo de 2015
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 comentarios
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!