필터 지우기
필터 지우기

Get MLDesktop instance from Java MatlabEngine

조회 수: 8 (최근 30일)
Marco Pasquali
Marco Pasquali 2018년 7월 19일
I'm trying to do some operations on the Matlab GUI from an external Java class. For this I need the current instance of MLDesktop, and following various examples I tried something like this
import com.mathworks.engine.*;
import com.mathworks.mde.desk.*;
import java.io.*;
public class javaMatlabConnect {
public static void main(String[] args) throws Exception {
String myEngine = "myMatlabEngine";
MatlabEngine eng = MatlabEngine.connectMatlab(myEngine);
MLDesktop jDesktop = eng.feval("com.mathworks.mde.desk.MLDesktop.getInstance"); // << This is where I get an error
// DO STUFF
eng.close();
}
}
This code sadly doesn't work: I get the exception
UnsupportedTypeException: Data Conversion Error for type: com.mathworks.mde.desk.MLDesktop
on the marked line. Probably there is a smarter way to do this, but I thought that my code should have worked.
Does anybody have a suggestion?
P.S.: I decompiled the com.mathworks.engine library, but I didn't see anything that could help me.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Call MATLAB from Java에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by