title: Octave C++ API (feval)- how to pass multiple parameters to feval?
body: <p><strong>Environment</strong>: Windows 7 Professional + octave 3.6.2 + Visual C++</p>
  
  <p>I was trying to embed octave into a standalone C++ program according to the tutorial:</p>
  
  <p><a href="http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-Programs" rel="nofollow">http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-Programs</a></p>
  
  <p>I managed to run the first program without problem, but the second one gives error message.</p>
  
  <p><strong>Simplified version of the second program</strong>:</p>
  
  <pre><code>int main (void)
  {
      string_vector argv (2);
      argv(0) = "embedded";
      argv(1) = "-q";
      octave_main (2, argv.c_str_vec(), 1);
  
      Matrix a_matrix = Matrix (1, 2);
      std::cout &lt;&lt; "GCD of [12, 16] is ";
  
  
      a_matrix(0)=12;
      a_matrix(1)=16;
  
      octave_value_list in = octave_value (a_matrix);
      octave_value_list out = feval ("gcd", in, 1);
  
      std::cout&lt;&lt;out(0).matrix_value()&lt;&lt;std::endl;
      return 0;
  
  }
  </code></pre>
  
  <p>the line with "feval" failed to execute. The reason is that in octave <strong>3.6.2</strong>, the function <strong>gcd no longer accept list of value as parameter</strong>, one has to call <strong>gcd(value1, value2, ...)</strong> instead of gcd([value1, value2, ...]), which was supported back in octave 3.2.4 , so this bring up my main problem here:</p>
  
  <p><strong>How can I pass multiple parameters to feval as separate values, so that I can call functions like gcd(value1, value2, ...) through octave's C++ API?</strong></p>
  
  <p>Ultimately, I need to do some graphics processing in a GUI application, so I may need to call functions like conv2 at the C++ side (which sadly, also requires multiple function parameters)</p>
  
  <p>Thank you in advance for any help</p>