Programming Previous page   Next Page

Debug, Backtrace, and Verbose Modes

In addition to warning messages, there are three modes that can be enabled or disabled with a warning control statement. These modes are shown here.

Mode
Description
Default
debug
Stop in the debugger when a warning is invoked.
off
backtrace
Display an M-stack trace after a warning is invoked.
off
verbose
Display a message on how to suppress the warning.
off

The syntax for using this type of control statement is as follows, where state, in this case, can be only on, off, or query.

Note that there is no need to include a message identifier with this type of control statement. All enabled warnings are affected by the this type of control statement.

Example 1 -- Entering Debug Mode on a Specific Warning

To enter debug mode whenever a Simulink actionNotTaken warning is invoked, first turn off all warnings and enable only this one type of warning using its message identifier. Then turn on debug mode for all enabled warnings. When you run your program, MATLAB will stop in debug mode just before this warning is executed. You will see the debug prompt (K>>) displayed.

Example 2 -- Enabling Verbose Warnings

When you enable verbose warnings, MATLAB displays an extra line of information with each warning that tells you how to suppress it:


Previous page  Saving and Restoring State Debugging Errors and Warnings Next page

© 1994-2005 The MathWorks, Inc.