Debugging in Octave

One of the most useful command to debug your code in octave is to enable these two parameters in the beginning of your code:

debug_on_warning(1);
debug_on_error(1);

this is to enter debug mode in Octave whenever a warning or error occurs.

To add a breakpoint, use
dbstop('yourfunctionname',1)
where 1 is the line number where you want to stop.
To go to next line, type
dbnext
To step into type
dbstep
To continue running, type
dbcont

to see the variable value, just type the name of the variable.

Advertisements

3 Responses

  1. […] useful debugging command in Octave Posted on May 9, 2008 by kurniawano In a previous post, I shared some Octave functions to do debugging.  Somehow I got problem in using dbstop function […]

  2. […] Debugging in Octave April 20081 comment […]

  3. Reblogged this on Sven Logan's Blog and commented:
    Short but useful wrapup which helped me much during my first debugging session in Octave!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: