I have value in matlab that has to given to python script. How should i pass the variable to it

1 次查看(过去 30 天)
a= 30;
b= 120;
c= 90;
system('python D:\ex.py');
how will i be able to access the variables a,b,c in ex.py

采纳的回答

Nisha Rajiv
Nisha Rajiv 2012-9-17
I have found it...This is what i wanted!
a= 30;
b= 120;
c= 90;
syscmd = sprintf('python D:\\ex.py %d %d %d', a, b, c);
system(syscmd)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by