MATLAB: Do MATLAB path changes made in the Command Window of a visible MATLAB Engine session affect subsequent MATLAB function calls

addpathcompilerMATLAB

I have an Excel application which uses the MATLAB Engine to connect to a MATLAB session that is already open. After connecting, I add the path of a DLL to the MATLAB search path from the Command Prompt. Will I be able to load the library and use its functions in MATLAB after this change from the calling EXCEL program? In general, when adding a directory to the MATLAB path from the Command Window of a visible MATLAB Engine session, would functions in these directories be available to the client application?

Best Answer

All changes in the MATLAB Engine session (even those made at runtime by the user from the MATLAB Command Window) will be reflected in future calls to that MATLAB session.
In your specific case, as long as the location of the DLL is added to the path when the LOADLIBRARY command is issued, it can be loaded into memory and its functions used from the external application via the Engine API.