简体   繁体   中英

Call Eviews from Matlab

I am trying to call Eviews (8, 32bit) from Matlab (2013a, 32bit), but without success so far. I used the following code in 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) ).

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:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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