title: assign value to gurobi variable
body: <p>I want to make a branch and bound from my problem in Gurobi with C#. If the value of <code>y[m]</code> is not binary, then branch value of every <code>y[m]</code> to 0 and 1 as an additional constraint. Here is the definition of <code>y[m]</code> and my code:</p>
  
  <pre><code>GRBVar[] y = new GRBVar[M];
  for (int m = 0; m &lt; y.Length; m++)
  {
   y[m] = master.AddVar(0.0, 1.0, 0.0, GRB.CONTINUOUS, "y" + m);
  }
  if (objectivevalue == master.ObjVal)
  y[1].Set(GRB.DoubleAttr.X, 1.0);
  </code></pre>
  
  <p>This code said </p>
  
  <blockquote>
    <p>error code 10004, error at GRBVar.Set.</p>
  </blockquote>
  
  <p>I think It must be from the new set value of y, but I don't know what's the correct syntax.</p>