フィルターのクリア

COM interface to open Matlab from another software

2 ビュー (過去 30 日間)
NF
NF 2018 年 4 月 11 日
コメント済み: NF 2018 年 4 月 20 日
I have to open and run a Matlab program when I call it from another software (Plant Simulation). I found that this has to be done with COM interface, that both supports. However I do not have any idea of how to do this. I found on Plant Simulation context help some command that can be used to control Plant Simulation from other softwares, but not viceversa. Is there a library with the commands that can be used from another software to control Matlab? If not, how can I do it? Thanks in advance
  8 件のコメント
Guillaume
Guillaume 2018 年 4 月 20 日
編集済み: Guillaume 2018 年 4 月 20 日

So to be clear, in your software if you do:

matlab:=createCOMObject("matlab.Application")

you get a window that open and then is probably force-closed by the OS. But if you do:

matlab = actxserver('matlab.Application')

in matlab, the same window that appear stays up? That is very odd, the two should be equivalent.

What about if you use a vb script. Save the following in a text file with extension .vbs

Set matlab = CreateObject("Matlab.Application")
Matlab.Visible = 1

and run this script from Windows command prompt with

cscript nameofscript.vbs

Again, this should pop up the matlab window and not close it. All three are equivalent, they ask Windows to instantiate a matlab COM object.

Note: some antivirus softwares and some configurations of windows may prevent you from running vb scripts.

NF
NF 2018 年 4 月 20 日
In the end I solved everything calling Plant Simulation from Matlab, it is way simplier. However, thank you a lot for the help!!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by