2

我正在尝试从 Matlab(2013a,32 位)调用 Eviews(8、32 位),但到目前为止没有成功。我在 Matlab 中使用了以下代码:

clear all; clc;

hm = actxserver('EViews.Manager.8')
hm = COM.Eviews_Manager
h = hm.GetApplication(0)
h = Interface.EViews_8.0_Type_Library.IApplication  
h.invoke

h.Show()
h.Run('wfcreate comEV u 4')
h.Run('genr x = @obsid')

我收到以下错误:

>> h = hm.GetApplication(0)
No appropriate method, property, or field GetApplication for class
COM.EViews_Manager_8.

有人可以帮忙吗?提前致谢。

4

2 回答 2

0

代码行

h = Interface.EViews_8.0_Type_Library.IApplication 

不是命令,是上面代码行的输出 ( h = hm.GetApplication(0))。

只需将其从脚本中删除即可。我认为这是问题所在。

于 2016-04-21T10:54:32.673 回答
0

至少,您可以在 EViews 中编写程序,然后使用 shell 从 Matlab* 调用它:

system(['"C:\Program Files\EViews 9\EViews9_x64.exe" "C:\Users\me\Documents\foo.prg"'])

*或Stata、R、Python、VBA等。

于 2017-01-04T18:53:21.800 回答