Is there a way to wait until a java or .NET process exits apart from using pause()? Using an example from this answer:
https://stackoverflow.com/a/8932157/3850072
while true
if proc.HasExited
fprintf('\nProcess exited with status %d\n', proc.ExitCode);
break
end
fprintf('.');
pause(.1);
end
I was trying to use proc.StartInfo.Arguments = '\wait'; or even proc.WaitForExit(); but these attempts didn't work. I can achieve what I want by using the system command instead, but in that case the output window of the console doesn't get displayed.
system('start /wait ping 127.0.0.1')? Uses system command and opens a new windowstatus = system('C:\SIMPACKv8.9\spck.bat')or let the output be shown bystatus = system('C:\SIMPACKv8.9\spck.bat &'), but in the second case Matlab continues, it doesn't wait for the process to be finished.ping 127.0.0.1didn't seem to do anything...