How to handle multi Matlab return values in Python
Afficher commentaires plus anciens
I'm using Matlab 2014b, and I want to call Matlab function from Python(2.7.6). Here is my Python script:
import matlab.engine as meng
import matlab as mat
eng = meng.start_matlab()
try:
x,y = eng.Fun_Py(3,4)
print x
print y
eng.quit()
except:
print "error in python script"
eng.quit()
and here is my Matlab script:
function [x,y]=Fun_Py(a,b) x=zeros(a,b); y=sum(x); end
When I ran the Python scipt, I got "error in python script".How can I solve this problem? Any help is appreciate.
Jason Shih
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Call MATLAB from Python dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!