Executing a Matlab function using java

2019-04-10 02:33发布

I'm writing an application which does image processing using matlab and later displays the result using Java's Interface. Due to certain reasons I've to use both Java and Matlab.

How can I use the matlab function in java ?? How to create and access the interface.

4条回答
Explosion°爆炸
2楼-- · 2019-04-10 02:56

As of R2016b you can use official MATLAB Engine API for Java, which seems to allow same functionality as matlabcontrol.

查看更多
干净又极端
3楼-- · 2019-04-10 02:58

A quick google brought up this http://j-integra.intrinsyc.com/support/com/doc/other_examples/Matlab.htm

Alternatively, can you execute your matlab function from the command line? If so you can use Runtime.getRuntime().exec("your matlab function")

查看更多
beautiful°
4楼-- · 2019-04-10 03:11

MATLAB Builder JA is one option to use MATLAB code in Java. This is a non free toolbox for creating a jar file from MATLAB code in order to be imported to Java. Take care of the restrictions concerning jar file creation.

Using Java classes inside MATLAB is much easier, as you can instantiate Java classes in MATLAB code. Undocumented Matlab is one valuable resource for Java integration in MATLAB.

Check Using Sun Java Classes in MATLAB Software for the official information provided by The MathWorks.

查看更多
Juvenile、少年°
5楼-- · 2019-04-10 03:12

matlabcontrol is a Java API which will allow you to call your image processing functions or scripts and return the results to Java. To get started, take a look at the walkthrough.

查看更多
登录 后发表回答