title: How to overshadow build-in function with dynamic variables
body: <p>When dynamically creating variables with <code>assignin</code> in Matlab, this does not work when the variable name conflicts with an existing function name. Here is an example:</p>
  
  <pre><code>function test(  )
      f()
      Beta
      beta
  end
  
  function f()
      assignin('caller','Beta',1)
      assignin('caller','beta',1)
  end
  </code></pre>
  
  <p>Evaluating <code>beta</code> fails, since it is not recognized as a variable.</p>
  
  <pre><code>&gt;&gt; test
  
  Beta =
  
       1
  
  Not enough input arguments.
  
  Error in beta (line 19)
  y = exp(betaln(z,w));
  
  Error in test (line 5)
      beta
  </code></pre>
  
  <p>Apparently this is because the initial JIT compilation recognizes function calls and does not over-shadow existing functions (in this case the <code>beta</code> function from the statistics toolbox) by dynamically created variables.</p>
  
  <p>My question is whether there is a way to force overshadowing functions using <code>assignin</code>, making the above example code work.</p>
  
  <hr>
  
  <p>PS: One way would be to initialize the variable name by adding <code>beta=[];</code> on the first line of <code>test()</code>. The problem is that in the application I am interested in, I don't know the variable names ex ante.</p>