What is shadowing?
Shadowing is when the name of a custom function/file (e.g. M-file) has the same name as a shipping MATLAB function/file. When this happens, often the custom function is used in place of the built-in, which can lead to unexpected behavior. Shadowing can lead to both errors as well as silent wrong answers.
How can I detect potential shadowing?
1. The "which" function displays the full path of functions, files, and a workspace variable with the same name:
https://www.mathworks.com/help/releases/R2021b/matlab/ref/which.html
>> which <function_name> -all
2. WINDOWS ONLY: Please download the attached M-file ("shadowFinder.m"), run it, and observe the Command Window output. Please send this output to us as well. If custom functions are returned, try re-naming them. This will avoid a direct conflict with the MATLAB function's name and may fix the underlying issue.
There are many different scenarios and this function cannot guarantee to cover all cases. Just because a function is listed does not mean it is the root cause, and just because there are no functions listed does it mean shadowing is not present. Use these outputs merely as a starting point.