How can I open an engine connection against a specific license?

engOpen lets me open a connection with Matlab engine. If I have 2 Matlab licenses, how can I tell the engine which to open?

Answers (1)

On Windows, the MATLAB Engine will start whichever MATLAB installation was last registered as a COM server. Quoting the documentation:
On Windows systems, engOpen opens a COM channel to MATLAB. The MATLAB software you registered during installation starts. If you did not register during installation, on the command line you can enter the command:
!matlab /regserver
On *nix platforms, I believe it should start whichever version of MATLAB it locates first on the PATH and LD_LIBRARY_PATH environment variables (see How do I compile and run a MATLAB Engine program on UNIX/Linux/Mac?)

3 Comments

Many thanks for your answer Kaustubha. My question is not regarding which Matlab version to open but which license file.
When in the command window I can open a specific Matlab license by typing: matlab -c licensefile
How can this extrapolate to Matlab Engine?
In *nix systems, when you start MATLAB you can specify the license file by establishing an LM_LICENSE_FILE environment variable that indicates the file. I wonder if the same thing can be done in this case, wonder whether the environment variables get noticed when ActiveX is started?
Randy: I don't know a whole lot about MATLAB license management, but if you can simply use the MATLAB startup option (-c licensefile) and you're on *nix, I wonder if you can use the startcmd parameter of the engOpen function to pass in the -c option.

Sign in to comment.

Categories

Products

Tags

Asked:

on 13 Nov 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!