warning
Prints the given input string, s, as a warning.
Syntax
warning(s, ...)
warning('on',id)
warning('off',id)
warning('query',id)
Inputs
- s
- Warning message. This can also be specified as a template string using the same format guidelines as printf.
- id
- Turn on/off warnings of a specific type. For now the only supported option is 'all'.
Examples
Simple warning message:
warning('This is a simple warning message')
Warning: This is a simple warning message in call to function help at line number 1
warning('This is a %s warning message, id [%d]', 'formatted', 24)
Warning: This is a formatted warning message, id [24] in call to function help at line number 1
Comments
The input, s, can also be specified as a template string, using the same format guidelines as printf. The warning set can be retrieved by using the command, lastwarn.