How to let the matlab to remember the previous directory?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have this task daily:
Many plots are generated within the same "run". Then I check each of them. If it's good, I save it through "file" -> "save as".
However, for every save I need to choose the directory again. I wonder if I can setup matlab and let it to remember the last directory just seconds ago like many other software.
Thanks.
0 Kommentare
Antworten (3)
Scott Webster
am 18 Dez. 2014
If you save your plots using a matlab command (e.g. print) then you can specify the path. You can also use a command like uiputfile to prompt the user for a filename etc...
pathname = 'C:\';
reply = input('Save plot? (y/n) (default n)','s');
if reply == 'y'
[plotfile,plotpath] = uiputfile('*.png','Select plot file name',pathname);
h=gcf;
plotfilepath=strcat(plotpath,plotfile);
print(h,'-noui','-r300','-dpng',plotfilepath);
end
1 Kommentar
Sean de Wolski
am 18 Dez. 2014
Pretty sure you'll have to take this approach as I believe it's the OS that selects the starting directory for save.
Azzi Abdelmalek
am 18 Dez. 2014
Create a cell array where you can store your directories
0 Kommentare
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!