MATLAB: How to reduce the amount of time it takes MATLAB to change the current directory to a directory containing a large number of files

cdcdingchangedirectoryfilesMATLABslow

MATLAB takes very long to change the current directory to a directory with a lot of files (of the order of thousands or hundreds of thousands of files). I would like to reduce the time it takes to change the current directory to this directory.

Best Answer

You may close the Current Directory browser on the MATLAB Desktop as MATLAB may be taking a long time to display the files in the Current Directory browser. To close the Current Directory browser, select the Desktop from the menu and ensure that Current Directory is unchecked.
For command line file operations such as changing directory or listing contents of a directory, refer the following functions:
<http://www.mathworks.com/help/techdoc/ref/f16-11063.html>