title: How to call octave function from python?
body: <p>I have a problem.m file that has a function like this: <code>myfun(p,m)</code>.</p>
  
  <p>It does some calculation and returns the result. For testing the execution of this function I have a test.m file that looks like this.<br>
      <code>myfun(myarg1,myarg2)</code></p>
  
  <p>If I run this file as:
      <code>octave test.m</code>
  Then it returns me the correct result which looks like this : 0.38007</p>
  
  <p>Now, the problem is when calling this function myfun(p,m) using python. I tried to use python library : oct2py </p>
  
  <p>The python code looks like this:</p>
  
  <pre><code>import sys
  import subprocess
  import oct2py
  import requests
  from oct2py import octave
  
  def myfun(p,m):
      octave.addpath('/mypath');
      oc = oct2py.Oct2Py()
      #res = octave.myfun(p,m nout=1);#this didn't work, hence comment
      #res = oc.myfun(p, m) #this didn't work, hence comment    
      x = oc.feval("myfun",p,m);
      print(x);
  
  if __name__ == '__main__':
      myfun(sys.argv[1],sys.argv[2])
  </code></pre>
  
  <p>When i run this code as: python FileName.py arg1 arg2 (same arguments i used in test.m) , it gives me a warning message and an empty list like this : </p>
  
  <blockquote>
    <p>warning: some elements in list of return values are undefined
    []</p>
  </blockquote>
  
  <p>I am not sure what to do about this. As the function seems to be returning correct result in a correct format when using octave. but for some reason oct2py is not working. </p>