MATLAB: Scripts with same name, different functionality located in different folders; what is the best way to organize these scripts so MATLAB won’t call the wrong script with the same name

guidematlab function

I have several scripts organized under different folders that have the same name, for example:
process_1/medianFilter.m
process_2/medianFilter.m
I also have a GUI for each of process_1 and process_2; however, my issue is that if I run process_1 and process_2 at the same time, MATLAB caches one of the 'medianFilter.m' files and uses it for both processes, even though they're supposed to use two different scripts that have the same name.
Adding and removing the path folders works to fix this issue when I run the GUIs one after another (i.e., I add paths when the GUI starts, then remove the paths when the GUI is closed). However, this doesn't work if the GUIs are run at the same time. What would be the best way to fix this, other than going through and renaming all the scripts so that none of them share names?

Best Answer

You could probably
clear medianFilter
I recommend that you also consider using "packages" or private directories