About: RevRagnarok's Blog
Browse by time:
- December 2020 (1)
- May 2020 (1)
- May 2019 (1)
- April 2016 (1)
- September 2015 (1)
- March 2015 (1)
- January 2015 (1)
- December 2014 (2)
- September 2014 (1)
- February 2014 (1)
- January 2014 (2)
- January 2013 (1)
- December 2012 (2)
- August 2012 (1)
- May 2012 (3)
- January 2011 (1)
- November 2010 (2)
- August 2010 (1)
- June 2010 (1)
- April 2010 (1)
- February 2010 (5)
- August 2009 (2)
- February 2009 (1)
- December 2008 (2)
- November 2008 (1)
- October 2008 (1)
- September 2008 (1)
- August 2008 (5)
- July 2008 (2)
- June 2008 (2)
- April 2008 (1)
- March 2008 (3)
- February 2008 (3)
- January 2008 (7)
- November 2007 (1)
- October 2007 (1)
- September 2007 (1)
- August 2007 (1)
- March 2007 (1)
- February 2007 (2)
- December 2006 (4)
- November 2006 (1)
- October 2006 (1)
- September 2006 (1)
- June 2006 (1)
- April 2006 (2)
- March 2006 (1)
- January 2006 (1)
- December 2005 (2)
- October 2005 (5)
- September 2005 (3)
- August 2005 (2)
- July 2005 (5)
- June 2005 (1)
- May 2005 (4)
- April 2005 (1)
- September 2004 (1)
- August 2004 (5)
- July 2004 (4)
- June 2004 (2)
- May 2004 (5)
- April 2004 (6)
- March 2004 (18)
- November 2003 (3)
- October 2003 (1)
- August 2003 (1)
- July 2003 (3)
- June 2003 (3)
- April 2003 (2)
- February 2003 (2)
- January 2003 (1)
- December 2002 (2)
- October 2002 (2)
- June 2002 (3)
- May 2002 (1)
- January 2002 (1)
Browse by author:
- rss RevRagnarok (170)
Browse by category:
- rss apache (2)
- rss arduino (1)
- rss boost (1)
- rss c++ (2)
- rss cygwin (18)
- rss ghost (5)
- rss import (96)
- rss links (55)
- rss linux (66)
- rss matlab (1)
- rss misc (26)
- rss mozilla (7)
- rss mysql (3)
- rss openwrt (1)
- rss perl (13)
- rss python (4)
- rss rant (20)
- rss raspberrypi (1)
- rss recipe (2)
- rss rpm (5)
- rss ruby (1)
- rss svn (8)
- rss tech (20)
- rss tomatousb (1)
- rss trac (8)
- rss vista (3)
- rss vmware (7)
- rss win7 (1)
- rss win9x (12)
- rss winxp (43)
MATLAB: Please dbstop here
I am doing a lot with MATLAB at work. I wanted the equivalent of a command that doesn't exist: dbstop here
or dbstop now
. Came up with two possible solutions with the help of the MathWorks tech support.
1: (from MATLAB documentation)
dbstop if warning 'MFILE:stop'; % Then later: if ~isequal(input, expected_input), warning('MFILE:stop','Boom!'), end; % At the end (or else things seem to slow down) dbclear if warning 'MFILE:stop';
When it drops into the debugger you can then issue the above dbclear
command by hand to get it to stop dropping there.
2: (my way)
This way uses the command keyboard
that I didn't know about until tech support told me about it - it is not listed in help dbstop
but it is a "see-also" in doc dbstop
which is annoying…
breakable=1; % Then later: if breakable && ~isequal(input, expected_input), keyboard, end;
When it drops into the debugger (you can still use F5, etc) you can then type breakable=0;
to stop it from dropping at that point. It doesn't clutter up the dbstop
stack so shouldn't slow down unrelated M-files.
- Posted: 16 years ago
- Author: RevRagnarok
- Categories: matlab
Comments
No comments.