1

I am having problems calling a Python function in Matlab. The question has already been answered on this website, Call python function from MATLAB, But solutions are not usable for me.

The topics presented above are several ways to use Python scripts in Matlab there. But I need to find a way to have multiple output arguments from a Python script I get in MATLAB.

this way :

system('python pythonfile.py argument')
system('python test.py 2')

and

>> r=python('sqd.py','3.5')
r =
12.25
>> r=python('sqd.py','5')
r =
25.0
>>

The above methods Not Able to two or more arguments of the data returned into Matlab! I want to get a few arguments in MATLAB. I am looking for a simple way similar to the above or easy way!

What's the solution for this?

Sorry for my poor English.I'm German.

Community
  • 1
  • 1
Pepe
  • 11
  • 2
  • How are you trying to call python + args in Matlab? – Mauro Baraldi Mar 23 '15 at 17:51
  • I could not succeed up with ways to get multiple output parameters. For example: >> [a b]=python('sample.py','2' '3' '5') – Pepe Mar 23 '15 at 18:28
  • Try the `pythoncall` project: https://github.com/pv/pythoncall – rayryeng Mar 23 '15 at 18:44
  • Thanks rayseng. But pythoncall on MATLAB 2014 problem. Whether you used and executed? How to? – Pepe Mar 23 '15 at 19:01
  • @Pepe - I apologize. I should have looked at the documentation before writing a comment. `pythoncall` doesn't work for newer versions of MATLAB. – rayryeng Mar 23 '15 at 20:08
  • @Pepe - Are you using MATLAB 2014? Which version? R2014a or R2014b? MATLAB has Python support within the environment. You have the ability to call Python functions directly without using `system`. – rayryeng Mar 23 '15 at 20:22
  • @rayryeng - I am using the R2014b version, but if need be I can use the R2014a version. Or newer. How to? Help me please – Pepe Mar 23 '15 at 20:34

0 Answers0