MATLAB: Am I unable to execute a DOS executable which requires user input from MATLAB 7.1(R14SP3)

!dosinputMATLAB

I want to execute a DOS executable, which needs a text file as an argument for processing. During processing, the program asks the user for input. For example,
D:\MyDosExecutable input.txt
Proceed (Y/N)?
In order to execute my DOS file from MATLAB, I issue either of the following commands in MATLAB:
dos('MyDosExecutable input.txt')
!MyDosExecutable input.txt
I do not receive the prompt for 'Proceed (Y/N)?' as expected. Instead MATLAB just display the "Busy" Signal. How do I generate the prompt for user input while my DOS file is being executed?

Best Answer

This is expected behavior, since the DOS or ! command from MATLAB 7.1 (R14SP3) executes the command in DOS and returns to the MATLAB window with no access to DOS from MATLAB.
To workaround this issue, execute the following command in MATLAB:
!MyDosExecutable input.txt &
The above command will open the DOS shell which is executing your DOS file. The user can pass their response during execution through this DOS shell, instead of MATLAB.