title: cvx return error with function definition not as script definition
body: <p>I have a very odd error with cvx/matlab.</p>
  
  <p>I'd like to solve SDP problem to get dual variable. Here is my code.</p>
  
  <pre><code>addpath(&lt;cvx_directory&gt;)
  cvx_setup
  
  cvx_begin
  variable r(n);
  variable R(n,n) symmetric;
  dual variable alpha;
  dual variable pi;
  minimize(trace(A0*R))
  pi: trace(A1*R) &lt;=0;
  alpha: r== diag(R);
  [R r;r' 1] == semidefinite(n+1);
  cvx_end
  </code></pre>
  
  <p>A0,A1 are given.
  When I write the above code in the script form it does not return any error.
  But I should pass the value of n (the size of variable), thus I edited the above code in the function form (Add function [output] = sdp(n) at the first line) and then it returns error :</p>
  
  <pre><code>Undefined operator ':' for input arguments of type 'cvx'.
  Error in  pi: trace(A1*R) &lt;=0;
  </code></pre>
  
  <p>If I move dual variable pi to right of the line (as like trace(A1*R)&lt;=0 : pi)</p>
  
  <p>then it returns  the other error :</p>
  
  <pre><code>Too many output arguments
  Error in alpha: r== diag(R);
  </code></pre>
  
  <p>What happen?</p>
  
  <p>// I added cvx_setup in the code to make sure that cvx is installed</p>