warning

Prints the given input string, s, as a warning.

Syntax

warning(s, ...)

Inputs

s
Warning message. This can also be specified as a template string using the same format guidelines as printf.
Type: string

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
Formatted warning message:
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.