This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

discard

Discard message

Syntax

discard(message_name)

Description

example

discard(message_name) discards a valid message. After a chart discards a message, it can remove another message from the queue in the same time step. A chart cannot access the data of a discarded message.

Examples

expand all

Check the queue for message M. If a message is present, remove it from the queue. If the message has a data value equal to 3, discard the message.

during:
if receive(M) == true
    if M.data == 3
        discard(M);
    end
end

Introduced in R2018b