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

6 views (last 30 days)
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?

Answers (1)

Harsha Phadke
Harsha Phadke on 4 Oct 2016
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.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!