Is there a way to browse parent folders of the current working folder?
显示 更早的评论
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?
采纳的回答
更多回答(1 个)
Hamoon
2015-9-11
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 个评论
Josh Kirby
2015-9-12
Hamoon
2015-9-12
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?
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!