Page 1 of 1

save X Log (MATLAB OUTPUT)

Posted: Tue Oct 19, 2010 7:20 pm
by satokoji
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.

Re: save X Log (MATLAB OUTPUT)

Posted: Tue Oct 19, 2010 9:11 pm
by startz
You ought to be able to get something using the Matlab diary() command.

Re: save X Log (MATLAB OUTPUT)

Posted: Tue Oct 19, 2010 10:05 pm
by satokoji
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
---

Re: save X Log (MATLAB OUTPUT)

Posted: Wed Oct 20, 2010 6:42 am
by startz
Sorry. That was my only guess.

Re: save X Log (MATLAB OUTPUT)

Posted: Wed Oct 20, 2010 8:15 am
by EViews Steve
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

Re: save X Log (MATLAB OUTPUT)

Posted: Wed Oct 20, 2010 5:28 pm
by satokoji
Thank you so much, Mr.Steve.
I'll try it.

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