Warning Messages

Warning messages are similar to error messages in that they are output into the console or command window.

However, on a warning, a script or function will continue its execution while it stops on error.

Warnings are used when a command cannot be performed or in some computations (for example, if a matrix is almost singular).

Although this can be changed, error messages are outputted in red, while warnings are outputted in black.

Example – Explicit Call to the Warning Function

warning('this is a warning')
will output:
Warning: this is a warning
Warning: 'E:/MYPATH'is not in path in the call to the function rmpath on line 1.