title: How do I differentiate an inline function in matlab
body: <p>suppose I write the following in matlab</p>
  
  <pre><code>c='x^2-6';
  f=inline(c);
  </code></pre>
  
  <p>Then f will be an inline function. I can evaluate f at different values by entering</p>
  
  <pre><code>f(2)
  f(5)
  </code></pre>
  
  <p>etc. </p>
  
  <p>However, when I try <code>diff(f)</code> it doesnt return <code>2*x</code>. How would I be able to get <code>2*x</code> from <code>f</code>?</p>