running exe file with inputs

조회 수: 7 (최근 30일)
Rima Hima
Rima Hima 2013년 4월 19일
댓글: biju undarath 2017년 12월 5일
Hi, i have a exe file and i run it using system with matlab , but i need to add the inputs (-flag1 value1 -flag2 value2) and i don't know how? Thank you.

채택된 답변

Friedrich
Friedrich 2013년 4월 19일
Hi,
you can use the system command or the bang operator (!), e.g.
!my.exe -flag1 value1 -flag2 value2
Or
[a,b] = system('my.exe -flag1 value1 -flag2 value2')
In the case value is number stores in a variable:
[a,b] = system(['my.exe -flag1 ',num2str(value1),' -flag2 ',num2str(value2)])
  댓글 수: 1
biju undarath
biju undarath 2017년 12월 5일
Can I assign flag1=value1 and flag2=value2 before using the system command ? Tried.But It is not reading. Like, flag1=value1 flag2=value2 [a,b]=system('my.exe -flag1 -flag2)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by