Why doesn't my current folder view refresh when I use the cd command in a function?

1 view (last 30 days)
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)

Accepted Answer

Jan
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
Jan
Jan on 28 Sep 2012
Edited: Jan on 28 Sep 2012
Copied from Answer-section:
Joao wrote:
Ah ok. So it won't work. Ok, thank you very much for your help!

Sign in to comment.

More Answers (0)

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!