我试图在.java文件中使用.m文件中的函数,但它不起作用。这是我得到的错误。
"Blocking in Event Dispatch Thread not allowed at com.mathworks.mvm.exec.FutureResult.waitInternal(FutureResult.java:316)"
try {
MatlabEngine eng = MatlabEngine.startMatlab();
JOptionPane.showMessageDialog(null, "p1");
double out= eng.feval("sih", "C:\\images\\patang\\test.JPG","C:\\images\\patang\\rdkivarnika.JPG");
JOptionPane.showMessageDialog(null, out);
} catch (EngineException | IllegalArgumentException | IllegalStateException | InterruptedException e1) {
e1.printStackTrace();
}