简体   繁体   中英

Executing a Matlab function using java

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.

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 .

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 import ed 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.

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")

从R2016b开始,您可以使用Java的官方MATLAB Engine API ,该API似乎提供与matlabcontrol相同的功能。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM