I use the background in languages โโsuch as Java or Python, where modular programming is included in the packaging system and the import directive (for example, namespace aliases). Historically, MATLAB's approach to solving problems such as name conflicts has been reduced to setting up / playing with MATLABPATH, renaming / extending identifiers with prefixes, etc. So far, I have successfully played with my own MATLAB packaging, adding a plus โ+โ sign in front of the folder name (MATLAB designation for the package also see here ). Obviously, they are gaining a very long time ;-) In principle, I returned to a similar problem, as discussed here without a solution. So let me rephrase my particular angle:
Suppose I have a + mypackage folder containing a myfun.m file with a function code with the same name.
How to achieve smoothing of the MATLAB function inside a custom (not java) package, as shown in the following python code:
from mypackage import myfun
?
[ EDIT ] Note that the import AFAIK keyword only works for java classes (from jvm to the MATLAB process). No, import works fine for both functions and aliases for objects and functions in both Java and MATLAB.
Perhaps related, but not the same .
[ EDIT2 ]
Python
from mypackage import myfun as anotherfun
equivalent to matlab
anotherfun = @mypackage.myfun