.exe file user input promt doesn't print in Matlab command window
5 views (last 30 days)
Hello, I am in need of some help. I am trying to call this C++.exefile through Matlab using system('command'). When I call it nothing comes up. But I when I put in the user input and press enter twice it prints the results tO me. And then call my goodbye function without my input. The file works great the windows command window but only on Matlab command it does that. Is there anything I can do to fix that? I do not wish to use mex to do that. Please help
Jason Ross on 29 Jan 2013
Can you recompile the .exe file to take command line arguments rather than relying upon interactive input? e.g.
myexe.exe -flag1 value1 -flag2 value2
Could you recompile it to take an input file? e.g.
Does command line redirection to pass an input file via the system command work? Reference : http://technet.microsoft.com/en-us/library/bb490982.aspx e.g.
myexe.exe < c:\temp\inputs.txt
You should be able to see if the "<" operator works outside of MATLAB. The other approaches of processing arguments and parsing input files require access to the source code for the .exe to build it in -- which you may or may not have access to. If the "<" operator works, you can mimic the command entry for your .exe in MATLAB (plus you could do error checking on the inputs), generate the text file, and then build the command line to pass in the file.