将命令发送到现有的MATLAB IDE命令窗口 [英] Send commands to an existing MATLAB IDE command window

查看:78
本文介绍了将命令发送到现有的MATLAB IDE命令窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打开MATLAB IDE之后,我们仍然能够从另一个进程写入其命令窗口吗?

After we open a MATLAB IDE, are we still able to write to its command window from another process?

在Windows中,我们可以使用MATLAB Engine API附加到现有的MATLAB,但是在Linux/Mac中不起作用.

In Windows, we could use MATLAB Engine API to attach to an existing MATLAB, while this does not work in Linux/Mac.

我们在Linux中有什么解决方案吗?

Do we have any solutions in Linux?

推荐答案

如果要通过单独的 java 进程进行连接,请考虑使用 JMI与之通信,即每个Matlab版本随附的java-to-matlab接口.

If you want to connect from a separate java process, consider using MatlabControl. It allows you to easily launch new Matlab instance from java process and then communicate with it though JMI, i.e. java-to-matlab interface that is shipped with each Matlab release.

是否还可以连接到现有的Matlab实例,但是您需要修改MatlabControl代码来做到这一点,并且需要从希望连接到的Matlab实例中手动执行一些命令.

Is it also possible to connect to existing Matlab instance, but you will need to modify MatlabControl code to do that, and you will need to manually execute some command from within the Matlab instance you wish to connect to.

关于未公开的Matlab的 MatlabControl/JMI 上有一系列不错的文章

There is a nice series of articles on MatlabControl / JMI on Undocumented Matlab.

从2016b开始,还有一个官方 MATLAB Java引擎API .

As of 2016b, there is also an official MATLAB Engine API for Java.

这篇关于将命令发送到现有的MATLAB IDE命令窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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