title: matlab: creating a symbolic vector
body: <p>I am trying to create a function using the symbolic toolbox in matlab.
  I have been having trouble creating a symbolic vector (not a vector of symbolic variables).
  Do you guys know a way to do this without creating and editing a text-like matlab function file in your path?</p>
  
  <ul>
  <li>*After creating the symbolic variables and all I use 'matlabFunction' to create and save the function.</li>
  </ul>
  
  <p>Example:</p>
  
  <p>Function:</p>
  
  <pre><code>function f=test1(x,a) {
     f=x(1)/a(1)+x(2)/a(2);
  }
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>a = sym('a', [1 2]);
  x = sym('x', [1 2]);
  % f(x, a) = sym('f(x, a)');
  r=x(1)/a(1)+x(2)/a(2);
  % f(x,a)=r;
  % handle=matlabFunction(f(x,a),'file','test1');
  handle=matlabFunction(r,'file','test1');
  </code></pre>
  
  <ul>
  <li>The problem is that the code seen above creates a function with the set of input arguments (x1, x2, a1, a2) instead of (x,a) and I can't change the form of input arguments, it must be uniform.</li>
  <li>In reality I am trying to write a function that will create a polynomial of specified degree and save it to the path so I could use 'eval' with it (which doesn't support polyval), but it will probably be useful for more.</li>
  </ul>