Windows Mex C function calling system() opens and closes windows. Is there a way to stop this?

5 次查看(过去 30 天)
Using Windows 7 or 10. I am calling a C++ Mex function from Matlab. In this Mex function I am calling the C system() function to run OS commands. Each time system() is called, a Windows cmd window opens and then closes very quickly. Since the Mex function is called many times, it is difficult to do anything else while this is happening.
Is there a way to suppress the opening of the window?

回答(1 个)

Harsha Phadke
Harsha Phadke 2016-10-4
Hey Mike,
I suspect that the Windows Command Prompt is being opened by the C system() call upon execution.
Could you post the exact OS command you are using in the system call? This might help in understanding the cause of this behavior for the Windows Command Prompt.
It could also help to look at the following links that suggest the ways to avoid this behavior.

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by