MATLAB: Updating function list in a script.

functionssymbolic

As part of some code I am writing I am printing out symbolic variables into a .m file (so that they can be called with d.p. arguments without using the incredibly sluggish subs). This works well except that when I create a new function matlab does not automatically note that the function has changed and will either not notice the function is present, complain about the arguments of the function, or use an old overwritten version.
Is there any command to update the list of possible functions (within the same working directory) or any other way to solve this problem?

Best Answer

>> help rehash
rehash Refresh function and file system caches.
rehash with no inputs performs the same refresh operations that are done
each time the MATLAB prompt is displayed--namely, for any non-toolbox
directories on the path, the list of known files is updated, the list of
known classes is revised, and the timestamps of loaded functions are
checked against the files on disk. The only time one should need to use
this form is when writing out files programmatically and expecting
MATLAB to find them before reaching the next MATLAB prompt.