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

6 ビュー (過去 30 日間)
Mike W
Mike W 2016 年 9 月 29 日
回答済み: Harsha Phadke 2016 年 10 月 4 日
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 Center および File ExchangeMATLAB Compiler についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by