found meantime a solution, use the command
isdeployed
From Help:
If you include this function in an application and compile the application with MATLAB Compiler™, the function will return true when the application is run in deployed mode. If you run the application containing this function in a MATLAB session, the function will return false.