title: Matlab - Invoking a function handle with generic parameter list
body: <p>I'm playing around with numerical integration methods and would like to have a function </p>
  
  <pre><code>myIntegrator(f,fParams)
  </code></pre>
  
  <p>In which I'll implement a numerical integration.</p>
  
  <p>As <em>f</em> might require any number of parameters, I'm looking for a generic way for <em>myIntegrator()</em>  to accept the function handle (@f) and invoke it using <em>fParams</em>.</p>
  
  <p>To better clarify,  I would like to call <em>myIntegrator</em>, once with  the following <em>@g</em> and then with <em>@h</em> (just some numerical functions):</p>
  
  <pre><code>g(x,y)
  h(x)
  </code></pre>
  
  <p>And I'm wondering if there is a single line of code I could use in <em>myIntegrator</em> that would perform :</p>
  
  <pre><code>myIntegrator(f,fParams)
     invoke(f,fParams)
  end
  </code></pre>
  
  <p>and would work both for </p>
  
  <pre><code>myIntegrator(@g,[x,y])
  </code></pre>
  
  <p>and</p>
  
  <pre><code>myIntegrator(@h,[x])
  </code></pre>
  
  <p>Your help is greatly appreciated!</p>