save X Log (MATLAB OUTPUT)

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

satokoji
Posts: 3
Joined: Tue Oct 19, 2010 6:12 pm

save X Log (MATLAB OUTPUT)

Postby satokoji » Tue Oct 19, 2010 7:20 pm

I use EViews7(Enterprise version).

When I call Matlab in my program with command "xopen(type=m)",
a window "X Log: MATLAB OUTPUT" open.

I would like to save this X Log as a text file in my program.

If you know a command or other better way, please let me know?

Thanks.

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: save X Log (MATLAB OUTPUT)

Postby startz » Tue Oct 19, 2010 9:11 pm

You ought to be able to get something using the Matlab diary() command.

satokoji
Posts: 3
Joined: Tue Oct 19, 2010 6:12 pm

Re: save X Log (MATLAB OUTPUT)

Postby satokoji » Tue Oct 19, 2010 10:05 pm

Thank you for your reply.

I tried diary() command, but empty file was only created.
I think this is becase diary() command records matlab command window, not X Log.
When I run my program, command history is written in X Log(EViews Window) not matlab command window.
My EViews program is as follows, is my use of diary() command wrong?

---my EViews program
xopen(type=m, case=lower)
xrun "diary matlablog.txt"
xrun "run ('main.m')"
xclose
---

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: save X Log (MATLAB OUTPUT)

Postby startz » Wed Oct 20, 2010 6:42 am

Sorry. That was my only guess.

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: save X Log (MATLAB OUTPUT)

Postby EViews Steve » Wed Oct 20, 2010 8:15 am

There's an undocumented feature that is similar to the LOGSAVE function for program output.

The command is XLOGSAVE. To save the X LOG output as a text file ("text" is the default type), do this:

Code: Select all

XLOGSAVE(type=text) c:\files\output.txt
To save as a Rich Text format (which retains all the color formatting), do this:

Code: Select all

XLOGSAVE(type=rtf) c:\files\output.rtf
To save the output as a text object in the current workfile, do this:

Code: Select all

XLOGSAVE(type=textobj) xoutput
This command will always overwrite the destination file/object if it already exists.

One thing to note is that there is currently a bug with this command -- it's supposed to let you put quotes around the destination filename so that you can specify spaces in the path, but this doesn't work. We'll have this fixed in the next patch. For now, just use a path without any spaces.

Steve

satokoji
Posts: 3
Joined: Tue Oct 19, 2010 6:12 pm

Re: save X Log (MATLAB OUTPUT)

Postby satokoji » Wed Oct 20, 2010 5:28 pm

Thank you so much, Mr.Steve.
I'll try it.

> Startz
I'm sorry, my English isn't very good.
Thank you, too.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests