access to matlab engine from java from same process

7 visualizaciones (últimos 30 días)
Someone Not Named Todd
Someone Not Named Todd el 3 de Mzo. de 2020
Comentada: Someone Not Named Todd el 4 de Mzo. de 2020
I want to call Matlab functions from java code from inside the same process? I haven't found any documentation on how to do this.

Respuestas (2)

Kojiro Saito
Kojiro Saito el 4 de Mzo. de 2020

Someone Not Named Todd
Someone Not Named Todd el 4 de Mzo. de 2020
I appreciate the links. But I was well aware of those links. My original question was connect in the SAME jre process as MATLAB is running. When I call connect (as described in the links you provided) it returns an error indicating you can not initialize the engine from the same process.
As another issue, my computer can NEVER find a shared engine on my local machine from a different process. (like the documentation in the links you provided) Virus scanner, firewall issues????? (which only my company has control over)
So I can successfully share an engine within MATLAB or from Java but I can NEVER get another process to use it. (never finds a running engine). So my work around was to just run inside of MATLAB and connect to the engine already instantiated, but there doesn't seem to be a way to do that.
  1 comentario
Someone Not Named Todd
Someone Not Named Todd el 4 de Mzo. de 2020
Here is the error:
Caused by: java.lang.IllegalStateException: Initializing MATLAB Engine API from MATLAB is not supported.
at com.mathworks.engine.MatlabEngine.<clinit>(MatlabEngine.java:76)

Iniciar sesión para comentar.

Categorías

Más información sobre Call MATLAB from Java en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by