Mahesh Gupta
Mahesh Gupta

Reputation: 2748

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.

Upvotes: 4

Views: 11406

Answers (4)

nirvana-msu
nirvana-msu

Reputation: 4077

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

Upvotes: 0

Joshua Kaplan
Joshua Kaplan

Reputation: 883

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.

Upvotes: 4

zellus
zellus

Reputation: 9582

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.

Upvotes: 2

Tarski
Tarski

Reputation: 5500

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

Upvotes: 1

Related Questions