User`s manual
Using the MATLAB Engine
4-5
GUI-Intensive Applications
If you have graphical user interface (GUI) intensive applications that execute
a lot of callbacks through the MATLAB engine, you should force these callbacks
to be evaluated in the context of the base workspace. Use
evalin to specify that
the base workspace is to be used in evaluating the callback expression, as
follows.
engEvalString(ep, "evalin('base', expression)")
Specifying the base workspace in this manner ensures that MATLAB will
process the callback correctly and return results for that call.
This does not apply to computational applications that do not execute
callbacks.