Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to see the detailed running process of matlab program?

Subject: how to see the detailed running process of matlab program?

From: Yi

Date: 23 Jan, 2009 15:28:02

Message: 1 of 11

Hey guys:

I have one question now. I have a long long program and a lot of loops inside the program. It may take the whole night to run the program. When the program stop, I want to see the whole process of the program. However, I printed the whole thing and suddenly found that it only gave me the lastest 150 pages. It's not enough for me. How can I see the whole thing, maybe it's thousands of pages. Thanks

Best Regards

Yi

Subject: how to see the detailed running process of matlab program?

From: Eric Williams

Date: 23 Jan, 2009 15:34:02

Message: 2 of 11

"Yi" <hvachy@163.com> wrote in message <glcnm2$hgj$1@fred.mathworks.com>...
> Hey guys:
>
> I have one question now. I have a long long program and a lot of loops inside the program. It may take the whole night to run the program. When the program stop, I want to see the whole process of the program. However, I printed the whole thing and suddenly found that it only gave me the lastest 150 pages. It's not enough for me. How can I see the whole thing, maybe it's thousands of pages. Thanks
>
> Best Regards
>
> Yi

If you are putting program output in your command window and then printing, you might want to check out "diary" command.

Subject: how to see the detailed running process of matlab program?

From: Yi

Date: 24 Jan, 2009 22:29:02

Message: 3 of 11

Hi:
I tried to search "diary" in Matlab help. However, I still did not understand how to use this command. Could you please tell me more detail? Should I write this command before running all the program or after getting results?

Thanks & Best Regards

Yi





>
> If you are putting program output in your command window and then printing, you might want to check out "diary" command.

Subject: how to see the detailed running process of matlab program?

From: Walter Roberson

Date: 25 Jan, 2009 04:47:11

Message: 4 of 11

Yi wrote:
 
> I tried to search "diary" in Matlab help. However, I still did not understand how to use
> this command. Could you please tell me more detail? Should I write this command before
> running all the program or after getting results?

It's pretty clear in the documentation:

  diary('filename') writes a copy of all subsequent keyboard input and the
  resulting output (except it does not include graphics) to the named file,
  where filename is the full pathname or filename is in the current MATLAB directory

The other forms of the diary command work the same way, affecting the recording
only of -subsequent- input and output.

--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Subject: how to see the detailed running process of matlab program?

From: Image Analyst

Date: 25 Jan, 2009 15:37:10

Message: 5 of 11

"Yi" <hvachy@163.com> wrote in message <glcnm2$hgj$1@fred.mathworks.com>...
> Hey guys:
>
> I have one question now. I have a long long program and a lot of loops inside the program. It may take the whole night to run the program. When the program stop, I want to see the whole process of the program. However, I printed the whole thing and suddenly found that it only gave me the lastest 150 pages. It's not enough for me. How can I see the whole thing, maybe it's thousands of pages. Thanks
>
> Best Regards
>
> Yi
------------------------------------------------------------------------------
Yi:
I'm not exactly sure what you mean. Do you want to see a file containing all the output the program generates, including command window text output plus any popup windows (figures, GUIs, dialog boxes), OR do you want a listing of every statement of code that got executed (in other words, a chronological listing of every line of source code that got executed)?
Regards,
ImageAnalyst
(Disclaimer: I don't know how to do either one! diary() apparently doesn't capture figures, GUIs, and dialog boxes.)

Subject: how to see the detailed running process of matlab program?

From: Steven Lord

Date: 26 Jan, 2009 15:08:13

Message: 6 of 11


"Image Analyst" <imageanalyst@mailinator.com> wrote in message
news:gli0v6$cv2$1@fred.mathworks.com...
> "Yi" <hvachy@163.com> wrote in message
> <glcnm2$hgj$1@fred.mathworks.com>...
>> Hey guys:
>>
>> I have one question now. I have a long long program and a lot of loops
>> inside the program. It may take the whole night to run the program. When
>> the program stop, I want to see the whole process of the program.
>> However, I printed the whole thing and suddenly found that it only gave
>> me the lastest 150 pages. It's not enough for me. How can I see the whole
>> thing, maybe it's thousands of pages. Thanks
>>
>> Best Regards
>>
>> Yi
> ------------------------------------------------------------------------------
> Yi:
> I'm not exactly sure what you mean. Do you want to see a file containing
> all the output the program generates, including command window text output
> plus any popup windows (figures, GUIs, dialog boxes), OR do you want a
> listing of every statement of code that got executed (in other words, a
> chronological listing of every line of source code that got executed)?
> Regards,
> ImageAnalyst
> (Disclaimer: I don't know how to do either one! diary() apparently
> doesn't capture figures, GUIs, and dialog boxes.)

For the former, theoretically you could approximate this using a timer
object to screen capture (GETFRAME) the whole screen periodically. You'd
miss windows that were below other windows, but as I said you could
approximate the former case.

For the latter case, you can use the ECHO function (ECHO ON ALL), but the
output gets to be ... quite verbose very quickly, particularly if you're
trying to trace through a long M-file that calls lots of other M-files (for
instance, the ODE solvers.)

--
Steve Lord
slord@mathworks.com

Subject: how to see the detailed running process of matlab program?

From: Yi

Date: 26 Jan, 2009 15:59:03

Message: 7 of 11

Hi Steve Lord:

I asked a question regarding the command “diary” in matlab forum and you are very nice and replied my question.

Now I think I have already known how to use this command, which is simply add a line of “diary (‘name’)” during the beginning of my code. Is it correct? Sometimes I can get all the running process and results, sometimes the information is incomplete. Is it because of my program is too complicated?

By the way, do you know how to avoid the warning information? There are too many same pieces of warning information is the daily file. Thanks

Best Regards

Yi



> > ------------------------------------------------------------------------------
> > Yi:
> > I'm not exactly sure what you mean. Do you want to see a file containing
> > all the output the program generates, including command window text output
> > plus any popup windows (figures, GUIs, dialog boxes), OR do you want a
> > listing of every statement of code that got executed (in other words, a
> > chronological listing of every line of source code that got executed)?
> > Regards,
> > ImageAnalyst
> > (Disclaimer: I don't know how to do either one! diary() apparently
> > doesn't capture figures, GUIs, and dialog boxes.)
>
> For the former, theoretically you could approximate this using a timer
> object to screen capture (GETFRAME) the whole screen periodically. You'd
> miss windows that were below other windows, but as I said you could
> approximate the former case.
>
> For the latter case, you can use the ECHO function (ECHO ON ALL), but the
> output gets to be ... quite verbose very quickly, particularly if you're
> trying to trace through a long M-file that calls lots of other M-files (for
> instance, the ODE solvers.)
>
> --
> Steve Lord
> slord@mathworks.com
>

Subject: how to see the detailed running process of matlab program?

From: Walter Roberson

Date: 26 Jan, 2009 16:33:07

Message: 8 of 11

Yi wrote:
 
> By the way, do you know how to avoid the warning information? There are too many same
> pieces of warning information is the daily file. Thanks

warning off

You can also be specific about -which- warning you want to turn off; see the
documentation for more details.

--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Subject: how to see the detailed running process of matlab program?

From: Steven Lord

Date: 26 Jan, 2009 16:40:14

Message: 9 of 11


"Yi" <hvachy@163.com> wrote in message
news:glkmk7$c53$1@fred.mathworks.com...
> Hi Steve Lord:
>
> I asked a question regarding the command “diary” in matlab
> forum and you are very nice and replied my question.

Just a comment: please don't both email your message and post it. Posting
to the newsgroup is sufficient, and keeps me from having to write the same
comment twice. Thanks.

> Now I think I have already known how to use this command, which is simply
> add a line of “diary (‘name’)” during the
> beginning of my code. Is it correct?

Yes; call DIARY with the name of the diary file in which you want the
information to be stored before you run your code. Afterwards, call "diary
off" (without the quotes) to turn off the diary.

> Sometimes I can get all the running process and results, sometimes the
> information is incomplete. Is it because of my program is too complicated?

Define "incomplete". The diary file should contain all the command window
output starting with the command executed immediately after the
"diary(name)" call and ending with the "diary off" call.

If the diary output ends at a certain point (say when you're calling another
function) make sure that function isn't calling DIARY itself. If that's the
case, you could use the -logfile option instead (as I believe I mentioned at
the end of the message where I described how to use DIARY.)

> By the way, do you know how to avoid the warning information? There are
> too many same pieces of warning information is the daily file. Thanks

You can disable all warnings, as Walter suggested, but I wouldn't do that
until I knew why the warnings were being thrown and knew I could safely
ignore them. In addition, I'd disable just those warnings I knew were
benign and could be safely ignored; type "doc warning" (without the quotes)
at the prompt and look at the syntax that starts with the "state" input
argument for more information.

--
Steve Lord
slord@mathworks.com

Subject: how to see the detailed running process of matlab program?

From: Yi

Date: 26 Jan, 2009 21:11:03

Message: 10 of 11

"Steven Lord" <slord@mathworks.com> wrote in message <glkp1e$p9l$1@fred.mathworks.com>...
>
> "Yi" <hvachy@163.com> wrote in message
> news:glkmk7$c53$1@fred.mathworks.com...
> > Hi Steve Lord:
> >
> > I asked a question regarding the command “diary” in matlab
> > forum and you are very nice and replied my question.
>
> Just a comment: please don't both email your message and post it. Posting
> to the newsgroup is sufficient, and keeps me from having to write the same
> comment twice. Thanks.
>
> > Now I think I have already known how to use this command, which is simply
> > add a line of “diary (‘name’)” during the
> > beginning of my code. Is it correct?
>
> Yes; call DIARY with the name of the diary file in which you want the
> information to be stored before you run your code. Afterwards, call "diary
> off" (without the quotes) to turn off the diary.
>
> > Sometimes I can get all the running process and results, sometimes the
> > information is incomplete. Is it because of my program is too complicated?
>
> Define "incomplete". The diary file should contain all the command window
> output starting with the command executed immediately after the
> "diary(name)" call and ending with the "diary off" call.
>
> If the diary output ends at a certain point (say when you're calling another
> function) make sure that function isn't calling DIARY itself. If that's the
> case, you could use the -logfile option instead (as I believe I mentioned at
> the end of the message where I described how to use DIARY.)
>
> > By the way, do you know how to avoid the warning information? There are
> > too many same pieces of warning information is the daily file. Thanks
>
> You can disable all warnings, as Walter suggested, but I wouldn't do that
> until I knew why the warnings were being thrown and knew I could safely
> ignore them. In addition, I'd disable just those warnings I knew were
> benign and could be safely ignored; type "doc warning" (without the quotes)
> at the prompt and look at the syntax that starts with the "state" input
> argument for more information.
>
> Steve Lord
> slord@mathworks.com
>
Thank you very very very very very much! I'm sorry to send you 2 same messages.
Last few questions:
1) My diary output do ends at a certain point, how to check those call functions have diary themselves? Basicly, they did not including any command directly show the word "diary".

2) You said I can disable all warnings in the diary output even though you don't suggest that. I read those warnings, and it doesn't hurt my final results. However, it repeat too many times (thousand of times because of loops), I don't want to see them in the diary output. Could you please tell me how to avoid them?

Thanks & Best Regards

Yi

Subject: how to see the detailed running process of matlab program?

From: ImageAnalyst

Date: 27 Jan, 2009 00:57:44

Message: 11 of 11

Check out the warning() function. You can use that to suppress all or
some specific warnings.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us