How do I integrate ZeroMQ library with Matlab. I want my Matlab program to be a subscriber of ZeroMQ publisher.
108 ビュー (過去 30 日間)
古いコメントを表示
How do I integrate ZeroMQ with Matlab. I would like my Matlab program to be a subscriber of ZeroMQ message, which is a publisher. Thank you.
0 件のコメント
回答 (2 件)
Will Grant
2017 年 1 月 12 日
編集済み: Will Grant
2017 年 1 月 12 日
From this blog post, it appears that the usage of JeroMQ (a pure-java implementation of ZeroMQ) is the easiest route to go.
3. get into the repository root and build with
mvn package
4. Put the .jar file [somewhere]
5. Add [somewhere] to your javaclasspath
6. Import the package and enjoy!
Edit
Adding the following useful links with example matlab code
0 件のコメント
Ivan Kostin
2021 年 6 月 11 日
From this post we can understand that the latest Matlab versions do not work with the latest JDK versions. Only 7 or 8 are supported.
But last version of JeroMQ from gihub seems to use JDK with version >=9. Because after I ran the example from git I got exception like this:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
at zmq.Signaler.send(Signaler.java:134)
...
I wonder if anyone has solved the JeroMQ in Matlab problem. Seems impossible.
1 件のコメント
Anil GURSES
2022 年 3 月 29 日
編集済み: Anil GURSES
2022 年 3 月 29 日
It is not impossible. You need to change your default JDK to 1.8 and compile it again with the command below.
mvn clean package
I tested this on Matlab R2022a and it works fine. If that doesn't work somehow, just change the compiler properties inside the pom.xml from 8 to 1.8(It's the same thing but give it a try). Lastly, add this to properties
<maven.compiler.release>8</maven.compiler.release>
or
<maven.compiler.release>1.8</maven.compiler.release>
参考
カテゴリ
Help Center および File Exchange で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!