title: '+' packaging or modular programming in matlab: analog of python's import?
body: <p>I come with the background in languages like Java or Python where modular programming is enabled by packaging system and import directive (aka namespace aliasing). Historically MATLAB's approach to resolve problems like naming conflicts boils down to setting/playing with MATLABPATH, renaming/extending identifiers with prefixes, etc. So far I have been successfully playing with native MATLAB packaging by prepending plus sign "+" before the folder name (MATLAB notation for package also see <a href="http://www.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html" rel="nofollow noreferrer">here</a>). Obviously  they are very long to type ;-) Basically I am back to the similar problem as discussed <a href="https://stackoverflow.com/questions/13076365/what-is-the-scope-of-matlabs-import-function">here</a> with no solution. So let me paraphrased for my particular angle:</p>
  
  <p>Assume I have folder <strong>+mypackage</strong> defined containing file <strong>myfun.m</strong> with the function code of the same name.</p>
  
  <p>How to achieve aliasing for MATLAB function inside the user (non-java) package as illustrated by the following python code:</p>
  
  <pre><code>from mypackage import myfun
  </code></pre>
  
  <p>?</p>
  
  <p>[<strong>EDIT</strong>] <strike>Please note that AFAIK import keyword works only for <a href="http://www.mathworks.com/help/matlab/ref/import.html" rel="nofollow noreferrer">java classes</a> (with jvm attached to MATLAB process). </strike> No, import is working perfectly fine for both functions and aliases for objects and function of both Java and MATLAB origin.</p>
  
  <p>Possibly related but not the <a href="https://stackoverflow.com/questions/6315047/using-matlab-to-import-another-m-file">same</a>.</p>
  
  <p>[<strong>EDIT2</strong>]</p>
  
  <p>python's</p>
  
  <pre><code>from mypackage import myfun as anotherfun
  </code></pre>
  
  <p>is equivalent to MATLAB's</p>
  
  <pre><code>anotherfun = @mypackage.myfun
  </code></pre>