An external program (.exe) started with "system" terminates early

1 次查看(过去 30 天)
I have a console application that computes a complicated function and outputs a text file with a resulting value. This application runs for about 8 minutes. I run it repeatedly with system("my.exe") within a surrogateopt function. The problem is that this .exe when started from MATLAB terminates early sometimes as if the process was destroyed (it can happen on first or on 25th iteration, no pattern noticed). When I run the application manually with current surrogateopt parameters, it runs completely fine.
I tried to disable antivirus, but it didn't help, so I guess, it might be an internal MATLAB problem.
Are there any known problems of that kind or any ideas why this might happen?

回答(1 个)

Denis Perotto
Denis Perotto 2024-4-28
In case somebody encounter the same problem. I created an additional RunExe.exe in C# that runs my main my.exe (written in C++) then exits. This RunExe.exe seems to start from MATLAB every time without problems.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by