rehash

Refresh function and file system path caches

Syntax

rehash
rehash path
rehash toolbox
rehash pathreset
rehash toolboxreset
rehash toolboxcache

Description

rehash with no arguments updates the MATLAB® list of known files and classes for directories on the search path that are not in matlabroot/toolbox. It compares the timestamps for loaded functions against their timestamps on disk. It clears loaded functions if the files on disk are newer. All of this normally happens each time MATLAB displays the Command Window prompt. Use rehash with no arguments only when you run a program file that updates another program file, and the calling file needs to reuse the updated version of the second file before the calling file has finished running.

rehash path performs the same updates as rehash, but uses a different technique for detecting the files and directories that require updates. Run rehash path only if you receive a warning during MATLAB startup notifying you that MATLAB could not tell if a directory has changed, and you encounter problems with MATLAB not using the most current versions of your program files.

rehash toolbox performs the same updates as rehash path, except it updates the list of known files and classes for all directories on the search path, including those in matlabroot/toolbox. Run rehash toolbox when you change, add, or remove files in matlabroot/toolbox during a session. Typically, you should not make changes to files and directories in matlabroot/toolbox.

rehash pathreset performs the same updates as rehash path, and also ensures the known files and classes list follows precedence rules for shadowed functions.

rehash toolboxreset performs the same updates as rehash toolbox, and also ensures the known files and classes list follows precedence rules for shadowed functions.

rehash toolboxcache performs the same updates as rehash toolbox, and also updates the cache file. This is the equivalent of clicking the Update Toolbox Path Cache button in the General Preferences dialog box.

Was this topic helpful?