Setting the Function Directory Path in MATLAB®
To be able to run a model that use an external MATLAB® function, the path directory of the function has to be set in MATLAB before it is called by COMSOL Multiphysics to evaluate the function.
To proceed you have these options to set the directory path in MATLAB:
Use the Set Path window to specify the MATLAB search path. To open the window type pathtool at the MATLAB prompt or in the MATLAB desktop go the Home toolbar, Environment group.