Programming Previous page   Next Page

Warning Statements

The warning statements that you put into your M-file code must contain the string that is to be displayed when the warning is incurred, and may also contain a message identifier. If you are not planning to use warning control or if you have no need to single out certain warnings for control, then you need to specify the message string only. Use the syntax shown in the section on Warnings. Valid formats are

Attaching an Identifier to the Warning Statement

If there are specific warnings that you want MATLAB to be able to apply control statements to, then you need to include a message identifier in the warning statement. The message identifier must be the first argument in the statement. Valid formats are

See Message Identifiers for information on how to specify the msg_id argument.


Previous page  Warning Control Warning Control Statements Next page

© 1994-2005 The MathWorks, Inc.