Is there a way to browse parent folders of the current working folder?

10 views (last 30 days)
I'm currently working on a project where I've separated the code into two folders which handle two conceptually related but functionally separate sets of tasks. If I sit at a parent folder of the two and add their folders to the path, I can easily view, edit, and run both sets of code at the same time, which is excellent for my workflow.
However, I'm running into issues related to running test cases on my code. I've been navigating to the folder where I want to dump the output and running a script, which works reasonably well and allows me to easily track the effects of changes to my code without needing to rewrite the test set. However, when I'm doing this, I'm effectively blind to all of my code, since all the browser shows me is the contents of the output folder.
Obviously, I can just keep the code open, or I can use the Open interface to navigate to the file that I want. Ideally, though, I'd like to flag a selected folder as the current working folder without collapsing the Current Folder browser onto it, letting me keep my setup there intact regardless of what I'm doing. Is there a way to do this?

Accepted Answer

Image Analyst
Image Analyst on 11 Sep 2015
So you have folders b and c, and folder "a" is the parent of them. The code in b or c puts output into a different folder "d". If you set the "Current folder" panel to view folder d, then you can't see your m-files in folders b or c, and you want to. I think that captures what you've said.
So, you can either bring up another program, such as Windows Explorer, or you can design your own GUI where you have listboxes where each listbox contains the files and monitors a different folder.
  2 Comments
Image Analyst
Image Analyst on 12 Sep 2015
That's not a no. It's an invitation for you to learn how to develop more powerful and sophisticated GUIs than you can do now. I suggest you start here: http://blogs.mathworks.com/videos/category/gui-or-guide/
Then look at this for an easy to use framework that will get you up and running in a short time: http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component Just use GUIDE to add a couple of listboxes that look at the other folders and you're all set.

Sign in to comment.

More Answers (1)

Hamoon
Hamoon on 11 Sep 2015
I'm not sure if I got your question correctly, but have you tried cd?
doc cd
you can change your current folder whenever you want inside your code and make changes there and go to another folder by
cd(newFolder)
is this what you want?
  2 Comments
Josh Kirby
Josh Kirby on 12 Sep 2015
That changes the GUI view of the current folder as well. I want to be able to keep the GUI view of the original root folder intact while still being able to have the local path relative to one of the the branches, rather than having the displayed root always be the same as the local path.
Hamoon
Hamoon on 12 Sep 2015
Actually Matlab does NOT change GUI view of the current folder when a code is running, that's a little bit tricky, you can start with the folder you want to see (suppose folder b) and in your code use "cd" to navigate to another folder (matlab does NOT show you this folder when your code is running, so you still see folder b), and in the end of your code again comeback to the folder b, so Matlab always will show you folder b. Isn't that what you want?

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!