简体   繁体   English

从Matlab呼叫Eviews

[英]Call Eviews from Matlab

I am trying to call Eviews (8, 32bit) from Matlab (2013a, 32bit), but without success so far. 我正在尝试从Matlab(2013a,32bit)调用Eviews(8,32bit),但到目前为止没有成功。 I used the following code in Matlab: 我在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')

I get the following error: 我收到以下错误:

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

Could anyone please help? 谁能帮忙吗? Thanks in advance. 提前致谢。

The line of code 代码行

h = Interface.EViews_8.0_Type_Library.IApplication 

is not a command, is the output from the above line of your code ( h = hm.GetApplication(0) ). 不是命令,而是代码上面的行( h = hm.GetApplication(0) )的输出。

Just remove it from your script. 只需将其从脚本中删除即可。 I think this is the problem. 我认为这是问题所在。

At the very least, you could write your program in EViews and then call it from Matlab* using the shell: 至少,您可以在EViews中编写程序,然后使用shell从Matlab *调用它:

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

*or Stata, R, Python, VBA, etc. *或Stata,R,Python,VBA等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM