how to pass an argument to python?
    조회 수: 6 (최근 30일)
  
       이전 댓글 표시
    
I have a python script ,I am calling it from MATLAB using the following command;
system('python','abc',1) //abc is a my python file and 1 is the argument;
My question is how to pass an argument by reference ,suppose there is a count looping variable named 'x' and I want it to send to python executable file.Please help,this is my final year project ,and it's very urgent,plz help !
댓글 수: 0
답변 (2개)
  Bjorn Gustavsson
      
 2014년 10월 28일
        Why not use sprintf?
exce_str = sprintf('python %s if the first argument is a string %02d with a second integer ergument',string_variable,i1))
HTH
댓글 수: 0
  Michelle Hirsch
    
 2014년 10월 28일
        If you have access to MATLAB R2014b, you could use the direct interface to Python. This interface supports passing data directly from MATLAB into Python functions.
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


