title: How to use fmincon to optimize two control vectors of a function
body: <p>I have a function of 2 different vector. These are the control vector (decision variables) of the function. I want to use <code>fmincon</code> to optimize this function and also get the both control vector results separately.
  I have tried to use handle ,@, but I got an error.
  The function is:  </p>
  
  <pre><code>function f = myFS(x,sv)      % x is a vector (5,1)
      f = norm(x)^2-sigma*(sv(1)+sv(2));
  end
  </code></pre>
  
  <p>%% I tried to write <code>fmincone</code> to consider both control vectors (x and sv)  </p>
  
  <pre><code>  [Xtemp(:,h2),Fval, fiasco] = fmincon(@(x,sv)myFS(x,sv)...
  ,xstart,[],[],[],[],VLB,VUB,@(x,sv)myCon(sv),options);
  </code></pre>
  
  <p>Here is the error I get:  </p>
  
  <blockquote>
    <p>Error using myFS (line 12) Not enough input arguments.</p>
    
    <p>Error in fmincon (line 564)
          initVals.f =
          feval(funfcn{3},X,varargin{:});</p>
    
    <p>Error in main_Econstraint (line 58) [Xtemp(:,h2),Fval, fiasco] =
    fmincon('myFS',xstart,[],[],[],[],VLB,VUB,@(x,sv)myCon(sv),options);</p>
  </blockquote>
  
  <p>Thanks</p>