title: How do I make a function from a symbolic expression in MATLAB?
body: <p>How can I make a function from a symbolic expression? For example, I have the following:</p>
  
  <pre><code>syms beta
  n1,n2,m,aa= Constants
  u = sqrt(n2-beta^2);
  w = sqrt(beta^2-n1);
  a = tan(u)/w+tanh(w)/u;
  b = tanh(u)/w;
  f = (a+b)*cos(aa*u+m*pi)+a-b*sin(aa*u+m*pi);  %# The main expression
  </code></pre>
  
  <p>If I want to use <code>f</code> in a special program to find its zeroes, how can I convert <code>f</code> to a function? Or, what should I do to find the zeroes of <code>f</code> and such nested expressions?</p>