title: How to convert symbolic expression to function handle for optimization [Matlab]?
body: <pre><code>syms a12 a13
  x=sym('x',[1,2]);
  fun=a12+a13
  fun=subs(fun,[a12 a13],[x(1) x(2)])
  %fun=matlabFunction(fun)
  fun = @(x) fun
  </code></pre>
  
  <p>I am pursuing the method to substitute all the symbols in a symbol expression by a variables vector and convert the symbol expression into a function @(x), so that I can use this function for optimization.</p>