lastwarn

Displays or sets the last warning message.

Syntax

lastwarn()

lastwarn(msg)

Inputs

msg
Message to be displayed.
Type: char | string
Dimension: string

Example

Simple lastwarn example.

inv(ones(3,3))
lastwarn()
Warning: Warning: singular matrix
ans = [Matrix] 3 x 3
Inf Inf Inf 
Inf Inf Inf 
Inf Inf Inf 
ans = Warning: Warning: singular matrix