Search code examples
windowsmatlababaqus

How to exit `abaqus` command window, after successful analysis of a job submitted, to `Matlab` script when called from `Matlab`


I called abaqus command from Matlab and ran (submitted) a job by:

dos(['"C:\Package\Intel\Composer XE 2011 SP1\bin\ifortvars.bat" intel64 && C:\Windows\system32\cmd.exe /k abaqus job=chaboche1job input=chaboche1job user=chaboche1 interactive'])

After successful completion, it does not automatically close the abaqus command and get back to Matlab script. I have to manually type 'exit'. Can it be done automatically not involving the user?


Solution

  • You explicitly use cmd.exe /k, the /k flag tells the CMD program to stay open after the program finishes.

    Replacing the /k flag with a /c flag should fix your problem.

    See a reference to the cmd.exe program here.