Call MATLAB from java

1 Ansicht (letzte 30 Tage)
Lochana Prasadi
Lochana Prasadi am 18 Mai 2016
I'm developing a software to interact with piano melodies in java using Netbeans IDE 8.0.2. There is a feature in my system to get a piano melody audio file in wav format and output the notations. In order to identify notes in the melody I used MATLAB 7.12.0 (R2011a) and already I can get the output. Now I want to execute that MATLAB commands in my java interface. So how can I try this? I saw there are some available libraries called MatlabControl and javabuilder. But I don't have a clear path to use those libraries correctly. I'm so glad if anyone can guide me.
Thanks in advance.

Akzeptierte Antwort

Malcolm Lidierth
Malcolm Lidierth am 19 Mai 2016
"I'm developing a software to interact with piano melodies in java using Netbeans IDE 8.0.2"
[1] There may be no need to do anything more than compile your code, add the jar to MATLAB's java path (using javaaddpath) and call into your code from MATLAB. In this case, MATLAB provides your work environment but you have access to the java code from it. Your code and MATLAB share a Java Virtual Machine, so all is easy.
[2] MatlabControl let's you run a java application but invoke and use the MATLAB engine from inside it. Typically, you will need pretty good knowledge of both MATLAB and Java. Java then provides your front-end with MATLAB being used typically for number crunching.
[3] Builder tools from TMW let you deploy a mixed Java/MATLAB code base as an app and, if you have the appropriate license, to deploy to end-users who do not have MATLAB.
Of these approaches, [1] is easiest/cheapest and ou can put a Java GUI on the front-end using AWT/Swing/JavaFX.

Weitere Antworten (0)


Mehr zu Just for fun finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by