I have set up a connection to Eviews from matlab with the following:
hm = actxserver('Eviews.Manager');
ha = hm.GetApplication;
I can successfully run Eviews commands one at a time with, for example,
ha.Run('rets.genr retd? = log(cum_?) - log(cum_?(-1))');
but since the one command at a time surrounded by ha.Run etc was tedious and also precluded local variables, loops and if's, I tried calling an entire Eviews program from Matlab using
ha.Run('run(v) "c:\models\drr\eviews\getretdata.prg"'); The program works fine in Eviews, but I get the following error when the command is invoked from Matlab
??? Error: The RPC server is unavailable.
Question: How do I run a whole Eviews program from Matlab?
PS I have gone the other way and have run Matlab functions from Eviews.
Calling Eviews program from Matlab
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Calling Eviews program from Matlab
I just tried this using Matlab 7.9.0 (R2009b) and it worked fine for me.
Perhaps it's something in the program? Try running the program from a VBA client like Excel or Word. See if an error appears.
If Excel or Word can call the EViews program but Matlab cannot, then it's an issue with Matlab...
Steve
Perhaps it's something in the program? Try running the program from a VBA client like Excel or Word. See if an error appears.
If Excel or Word can call the EViews program but Matlab cannot, then it's an issue with Matlab...
Steve
Re: Calling Eviews program from Matlab
Thanks Steve. It worked today. I must have had a contamintaed connection yesterday.
Today's question: Is there any documentation about what the various commands (eg GetGroup v. GetGroupEx) do? I have been guessing based on the names, but it would be nice to know options etc.
In particular, I have been using GetGroup to retrieve a Group of series from Eviews to Matlab. In Matlab, it creates a cell array, but it effectively only a matrix of numbers. I lose the dates and the headers. Is there any option to retrieve all Group data including series names and date associated with number. IE what looks like an Eviews Group.
Today's question: Is there any documentation about what the various commands (eg GetGroup v. GetGroupEx) do? I have been guessing based on the names, but it would be nice to know options etc.
In particular, I have been using GetGroup to retrieve a Group of series from Eviews to Matlab. In Matlab, it creates a cell array, but it effectively only a matrix of numbers. I lose the dates and the headers. Is there any option to retrieve all Group data including series names and date associated with number. IE what looks like an Eviews Group.
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Calling Eviews program from Matlab
We provide a whitepaper on our website that provides those details.
http://eviews.com/download/whitepapers/ ... mation.pdf
Steve
http://eviews.com/download/whitepapers/ ... mation.pdf
Steve
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Calling Eviews program from Matlab
About the GetGroup call, try this to get the date column:
The "@date" value should return the dates you are looking for. Unfortunately, there isn't a way to get the series names (column headers) in the GetGroup output -- however, you can do a Lookup call before calling GetGroup to get the list of names beforehand. Look at the bottom of page 3 of the PDF documentation...
Once you have each name, they should match the output of GetGroup (except for the @date column).
Steve
Code: Select all
app.GetGroup("@date series1 series2", ...Once you have each name, they should match the output of GetGroup (except for the @date column).
Steve
Re: Calling Eviews program from Matlab
Hi, All:
I wrote the following script [part] to call EViews (64 bit) from Matlab 2013a (64 bit) four months ago.
It was workable before, but it is failed now. I don't change anything. May anyone help me to solve this problem? Thanks!
[Error Messenge]
h = hm.GetApplication(0)
No appropriate method, property, or field GetApplication for class
COM.Eviews_Manager.
I wrote the following script [part] to call EViews (64 bit) from Matlab 2013a (64 bit) four months ago.
It was workable before, but it is failed now. I don't change anything. May anyone help me to solve this problem? Thanks!
Code: Select all
clear all; clc;
hm = actxserver('Eviews.Manager')
hm = COM.Eviews_Manager
h = hm.GetApplication(0)
% h = Interface.EViews_1.0_Type_Library.IApplication % EViews 7
% h = Interface.EViews_8.0_Type_Library.IApplication % EViews 8
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.
Who is online
Users browsing this forum: No registered users and 2 guests
