MATLAB gives users great flexibility in defining function names, but this can sometimes lead to minor confusion. There are no "reserved" function names in MATLAB; even the built-in functions like 'plot' and 'disp' can be (too?) easily "overloaded" by the user. Placing a file called 'plot.m' in the current working directory is enough to temporarily replace MATLAB's built-in plot function with a user-defined function of the same name.

This can be confusing, since there will be no warning message that a default function has been preempted. Typing 'help plot' will not provide any clues unless you have documented your plot.m function in your working directory. The author has even seen a case where a commercial package shipped with a function that unintentionally overloaded a MATLAB function; as it was a (closed-source) mex function, it was not possible to simply edit the function, making it impossible to use the two functions together.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement