title: YALMIP is returning that a program is infeasible when it is not
body: <p>I'm having a problem trying to use <a href="http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.HomePage" rel="nofollow">YALMIP</a>; I suspect I'm doing something silly and I would greatly appreciate if someone pointed out what it is.</p>
  
  <p>I'm trying to solve some SDPs. When I don't define an objective, YALMIP returns a solution (implying that the problem is feasible). However, when I attach an objective to it, YALMIP returns that the problem is infeasible, which has left me a bit perplexed.</p>
  
  <p>Here's the code for the simplest SDP I could cook up in which the above happens. Declaring the variables and setting the constraints is as follows:</p>
  
  <pre><code>y = sdpvar(6,1);
  M = sdpvar(3,3);
  
  C = [0,0,0,0,0,0; 0,0,0,0,0,0; -2,0,1.8,0,2,1; 0,0,0,0,0,0; 1,0,-1,0,-1.2,0;
       0,0,0,0,0,0;];
  
  F = [C*y==0, y(6) == 1, M&gt;=0];
  
  F = [F,M(1,1) == y(1), M(2,1) == y(2), M(3,1) == y(3),...
       M(2,2) == y(4), M(3,2) == y(5), M(3,3) == y(6)];
  </code></pre>
  
  <p>Now if I merely ask YALMIP to find a feasible solution with</p>
  
  <pre><code>solvesdp(F)
  </code></pre>
  
  <p>it returns</p>
  
  <pre><code>info: 'Successfully solved (LMILAB)'
  problem: 0
  </code></pre>
  
  <p>and some feasible M and y (I've checked that they indeed are). However, if I append the objective "minimise y(3)" (or indeed any linear combination of the entries of y) with</p>
  
  <pre><code>solvesdp(F,y(3))
  </code></pre>
  
  <p>it returns that the problem is infeasible:</p>
  
  <pre><code>info: 'Infeasible problem (LMILAB)'
  problem: 1
  </code></pre>
  
  <p>and y and M are full of "NaN" tokens.</p>
  
  <p>Many thanks in advance.</p>