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?

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 11월 13일
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

Randy
Randy 2012년 11월 13일
편집: Randy 2012년 11월 13일
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

태그

질문:

2012년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by