PUSHD(directory/file-spec) stores the current working directory and changes current directory to the one specified in the string directory-spec. To get back to the stored directory call POPD, see help popd. PUSHD cal also be used to jump to a directory containing a specified file.
PUSHD stores the current directory. Go back to the pushed directory using POPD, see help popd.
PUSHD stores a stack of pushed directories. Calling POPD will pop you one step up the stack.
These two files, PUSHD and POPD are intended to mimic the functions with the same names in UNIX/Linux and DOS.
Peter (PB) Bodin (2020). pushd (https://www.mathworks.com/matlabcentral/fileexchange/8103-pushd), MATLAB Central File Exchange. Retrieved .
It worked very weel for me
setpref leads to undesirable behavior when running many instances of matlab at once.
With the bugfix, capability of a stack and some time to
test it out, its now time to upgrade my last rating. Its a
clean code that does its job well.
Please do not download the version from 2005-08-10. This version introduced another bug. Wait until the date 2005-08-11 or later is registered under the Changes heading below. /PB
Its quite nice, allowing me to hop around directories
simply, then pop back. I like the ability to go to a
directory that holds an existing function.
I did want to be able to do several pushes, then pop
back up the stack. I might have given it a 5 rating had
this been possible.
There is a minor bug however. The initial addpref call was
missing a third argument.
Added some error trapping to adapt to new outputs of WHICH for built-in functions.
Added some error trapping.
Simplified the code.
Fixed a bug. Added stack functionality.
Changed from using setappdata to setpref in order to make the pushed dir available in separate MATLAB sessions.
Inspired by: Quick Folder Navigation