When you created double.m in a local directory, and put the local directory on the path, that affected most calls to double(). MATLAB mostly finds appropriate routines by name: it usually starts at the beginning of the MATLAB path and looks for a double() in each directory until it finds one. It does not matter that the first routine you invoke does not call double(): that routine invokes another routine that does call double(), and the double.m that you put on the path now overrides the built-in double() routine.
You should not name your .m files the same as any Mathworks-provided routine unless you want your routine to be called instead of the Mathworks provided routine.
Best Answer