1) As a quick initial step, search for the function name in the MATLAB online documentation. If the function does not appear in the search results, it is likely not part of any current MATLAB toolbox.
Note that the online documentation archive only covers the past 5 years. If the source code was written more than 5 years ago, it might reference a MATLAB function that existed only in previous versions of MATLAB.
2) If the code runs as expected in your current MATLAB session, use the "which" function to locate the source of the function name:
If the function is user-defined, the output will show the path to the .m file where the function is defined. For example:
If the function belongs to a MATLAB toolbox, the output will show a path that is within the MATLAB installation directory, typically containing the name of the toolbox. For example:
C:\Program Files\MATLAB\R20XXx\toolbox\<sometoolbox>\funName.m
If the function is overloaded or has multiple definitions, the "which -all" command will list all the locations.