如何用mathlab软件传递java应用程序? [英] how to communicate a java application with mathlab software?

查看:94
本文介绍了如何用mathlab软件传递java应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何使用windows7中的mathlab软件与java独立应用程序进行通信....

必须设计一个java应用程序,它将与photoshop和后端mathlab一起工作。(图像处理技术)在mathlab中。

can anyone tell me how to communicate java standalone application with mathlab software in windows7....
has to design a java app which will work as photoshop along with backend mathlab.(image processing technology in mathlab).

推荐答案

正如我看到matlab java界面以这种方式工作:Matlab能够运行一个jvm并在其中运行一段java代码如果你在java中为matlab编写一个插件,可以选择创建/调用你的类/方法: http: //www.mathworks.com/help/matlab/matlab_external/product-overview.html [ ^ ]

在为matlab编写插件之后,你可以编写一个完全独立的独立java应用程序,你可以构建某种类型的在matlab内部运行的插件之间的IPC和独立的Java应用程序。对于此IPC,我建议使用本地TCP套接字连接,但您可以使用Google来研究其他IPC选项。我总是使用TCP套接字,如果它适用于IPC,无论使用何种语言,因为它具有以下优点:

- TCP是标准的并且有多种语言可用,你可以连接用不同语言编写的组件语言很容易。

- TCP可以用来连接组件,即使它们位于不同的机器上,尽管这种方式的速度/延迟可能比同一台计算机上的本地连接更差。 b / b
matlab端插件可能是一小段代码,它将一些控制命令发送到独立应用程序和/或从应用程序接收一些命令。根据matlab支持的编程接口,如果其他脚本语言也具有在java独立应用程序中可用的IPC机制(例如套接字),您也可以用非java语言编写它。



根据您的目标,这里是一个商业解决方案,似乎将一些matlab库导出为java代码,因此您可以将它们直接构建到Java应用程序中: http://www.mathworks.com/products/javabuilder/ [ ^ ]
As I see the matlab java interface works this way: Matlab is able to run a jvm and to run a piece of java code inside it by creating/calling optionally your classes/methods if you write a "plugin" for matlab in java: http://www.mathworks.com/help/matlab/matlab_external/product-overview.html[^]
After writing your plugin for matlab you can write a completely separate standalone java application and you can build up some kind of IPC between the plugin that runs inside matlab and the standalone java app. For this IPC I recommend a local TCP socket connection but you can use google to research other IPC options. I always use TCP sockets if it is suitable for IPC regardless of the language in use because it has the following advantages:
- TCP is standard and is available in many languages, you can connect components written in different languages easily.
- TCP can be used to connect the components even if they reside on separate machines although this way the speed/latency may be worse than in case of a local connection on the same computer.

The matlab side plugin will probably be a small piece of code that sends some control commands to the standalone app and/or receives some commands from the app. Depending on the supported programming interfaces of matlab you can write it in a non-java language too if the other scripting language has an IPC mechanism (for example sockets) that is available in java standalone app too.

Depending on your goals here is a commercial solution that seems to export some matlab libraries as java code so you can build them directly into a java application: http://www.mathworks.com/products/javabuilder/[^]


这篇关于如何用mathlab软件传递java应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆