From: Max on
Hello,
I'm wondering if there is a way to detect if .m file was executed from matlab editor or it was called from external dll using matlab engine API (engOpen(), engEvalString(), engGetVariable()...etc).

For example, I need to run the same file form different environments, but only show graphics when I'm running .m file from matlab editor, otherwise suppress graphics output.

I appreciate your input.
Thank you
From: ImageAnalyst on
Look into "isdeployed"
From: Max on
"x = isdeployed returns true (1) when the function is running in deployed mode and false (0) if it is running in a MATLAB session."

Thank you for your input. Unfortunately it does not help in my case. Any call to Matlab Engine API creates "Matlab Command Window" and thus opens a new matlab session. The real question is how to differentiate between regular session and session initiated by call to engOpen() from external dll.