MATLAB: Running exe file with inputs

exe file

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.

Best Answer

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)])