Why doesn't my current folder view refresh when I use the cd command in a function?
1 view (last 30 days)
Show older comments
Hello,
I've written a function of my own and it starts by asking to change the 'current folder' (so that it's easier for other people to use it) and then uses the cd command. However, since the function doesn't end at that command the 'current folder' view only refreshes when the rest of the function is finished.
Does anybody know how to fix this? It would be really handy if the view updated immediately. Thanks. I'll show you the beginning of the code.
function [some]=eval(N)
newfolder=input('Write the folder where the files are located \n','s'); newfolder=num2str(newfolder); cd(newfolder); filebrowser;
for S=1:N ... (continues without refreshing the current folder view)
2 Comments
Jan
on 27 Sep 2012
Btw, using "eval" as name of a user-defined function will have such strange side-effects, that I do not dare to try it by myself.
Accepted Answer
Jan
on 27 Sep 2012
The current-folder view contains the list of folders, which are current while the command line is active. During your program runs, the command line is not active. Otherwise a program, which dives into a folder-hierarchy like GENPATH would fill the history immediately.
1 Comment
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!