title: How can I create function pointers from a string input in MATLAB?
body: <p>If I use the <code>inline</code> function in MATLAB I can create a single function name that could respond differently depending on previous choices:</p>
  
  <pre><code>if (someCondition)
    p = inline('a - b','a','b');
  else
    p = inline('a + b','a','b');
  end
  
  c = p(1,2);
  d = p(3,4);
  </code></pre>
  
  <p>But the inline functions I'm creating are becoming quite epic, so I'd like to change them to other types of functions (i.e. m-files, subfunctions, or nested functions).</p>
  
  <p>Let's say I have m-files like <code>Mercator.m</code>, <code>KavrayskiyVII.m</code>, etc. (all taking a value for <code>phi</code> and <code>lambda</code>), and I'd like to assign the chosen function to <code>p</code> in the same way as I have above so that I can call it many times (with variable sized matrices and things that make using <code>eval</code> either impossible or a total mess).</p>
  
  <p>I have a variable, <code>type</code>, that will be one of the names of the functions required (e.g. <code>'Mercator'</code>, <code>'KavrayskiyVII'</code>, etc.). I figure I need to make <code>p</code> into a pointer to the function named inside the <code>type</code> variable. Any ideas how I can do this?</p>