Executing a Matlab function using java

不羁岁月 提交于 2019-12-06 06:13:09

问题


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.


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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



来源:https://stackoverflow.com/questions/5003388/executing-a-matlab-function-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!