I already tried to find the answer to this problem, and asked my question in Matlab Central without an answer. Now I hope that one of you can help me solve my problem. Here is my (improved) question:
The title already pretty well describes what I need to do: I need to check from the MEX file whether Matlab R2013a is running on Linux with or without a graphical interface.
Background: I am running a C / C ++ program (from which I can use sources, but I am not allowed to change them, only to add new files if necessary!) From Matlab. I wrote several (additional) MEX files that allow the program to use mexCallMATLAB to evaluate m files. Now I need to know where I should direct the output of the C / C ++ program, depending on whether Matlab was launched with or without a graphical interface. I need to get this information from a function called from my MEX files. Until now, I can redirect the output of the C / C ++ program by changing the hard-set parameters, but I can already direct it to the correct outputs, that is, to the console without, or to the Matlab command window with a graphical interface.
Prior to R2012x, verification was possible using the C ++ function isatty(), but with R2013a on this verification no longer works, which means that Matlab always starts only from the console, even if it was launched with a graphical interface.
Do any of you know such a feature or other solution to my problem?
Thanks to the people in advance!
Cheers, mindm49907
source
share