基于 MATLAB 的 Java 程序
我正在设计一个基于 MATLAB 的算法。是否可以从 Java 应用程序调用 MATLAB 源代码?
有人遇到过这样的问题吗?
I am in the process of designing a MATLAB-based algorithm. Is it possible to call that MATLAB source code from a Java application?
Has anyone come across such a issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 MATLAB Builder JA。该程序允许您将 matlab 代码转换为 java 类。
have a look at MATLAB Builder JA. This program allows you to convert your matlab code into java classes.
可以使用 matlabcontrol 从 Java 调用 MATLAB。它是专门为此设计的 Java API。但是,它要求 MATLAB 与执行 Java 代码的计算机运行在同一台计算机上。当您放置 Android 标签时,我假设您想在 Android 设备上运行它(尽管您的描述中没有提及),并且没有已知的方法可以在 Android 上直接运行 MATLAB 代码。 matlabcontrol 肯定不会这样做,但您可以使用它来编写一个 Java 应用程序,充当 Android 应用程序的服务器。同样,您可以使用 MATLAB Builder JA 执行相同的操作,它生成需要 MATLAB 或 MATLAB 编译器运行时(免费提供 - 因此用户无需购买 MATLAB)的代码。
It is possible to call MATLAB from Java using matlabcontrol. It's a Java API designed specifically for that. However, it requires MATLAB to be running on the same machine that the Java code is executing on. As you put the Android tag I assume you want to run this on an Android device (although not mentioned in your description), and there is no known way to directly run MATLAB code on Android. matlabcontrol definitely will not do that, but you could use it to write a Java application which acts as a server for your Android application. Similarly, you could do the same with MATLAB Builder JA which generates code that needs either MATLAB or the MATLAB Compiler Runtime (which is available for free - so users would not need to buy MATLAB).