Main Content

rehash

Refresh function and file system path caches

Description

rehashupdates the MATLAB®list of known files and classes for folders on the search path that are not inmatlabroot. 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. Userehashwith no arguments only when you run a program file that updates another program file, and the calling file needs to use the updated version of the second file before the calling file has finished running.

rehash pathperforms the same updates asrehash, except that it unconditionally updates the list of known files and classes for all folders on the search path that are not inmatlabroot. Runrehash pathonly if you receive a warning during MATLAB startup notifying you that MATLAB could not tell if a folder has changed, and you encounter problems with MATLAB not using the most current versions of your program files.

rehash toolboxperforms the same updates asrehash path, except it updates the list of known files and classes forallfolders on the search path, including those inmatlabroot. Runrehash toolboxwhen you change, add, or remove files inmatlabrootduring a session. Typically, you should not make changes to files and folders inmatlabroot.

rehash toolboxcacheperforms the same updates asrehash toolbox, and also updates the cache file.This is equivalent to clicking theUpdate Toolbox Path Cachebutton in the General Preferences dialog box.

Introduced before R2006a