arokem / python-matlab-bridge

A simple Python => MATLAB(R) interface and a matlab_magic for ipython
BSD 2-Clause "Simplified" License
332 stars 97 forks source link

Trivial issue on passing multiple arguments #229

Closed nipunbatra closed 7 years ago

nipunbatra commented 8 years ago

Hi I'm trying to call a very simple function called demoSum.M

function y = demoSum(a,b)
    y=a+b;
 end

Calling it as follows says that Not enough input arguments.

res = mlab.run_func('/Users/nipunbatra/Desktop/demo_sum.m', {'a':1,'b':2})

Calling as follows also doesn't work.

res = mlab.run_func('/Users/nipunbatra/Desktop/demo_sum.m',1,2, nargout=1)

Am I missing something really trivial. I have noted that in your examples you have made use of args and then extracting the variables from args. I thought that this was the only way possible till I stumbled upon this issue, where the function call was mlab.run_func('multiply_them.m', dummy1, dummy2, dummy3, nargout=1)

Jvanschoubroeck commented 7 years ago

Hello @nipunbatra, are you conscious of the fact that the function name you want to call is demoSum.m and that the function you are calling using mlab.run_func is called demo_sum.m?

The error Not enough input arguments might just have put you on the wrong track.

Jvanschoubroeck commented 7 years ago

@arokem, I think this issue can be closed.