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.

isvalid

Determine if message is valid

Syntax

isvalid(message_name)

Description

example

isvalid(message_name) checks if a message is valid. A message is valid if the chart has removed it from the queue and has not forwarded or discarded it.

Examples

expand all

Determine whether the message M is valid. If the message is valid and has a data value equal to 6, discard the message.

during:
if isvalid(M) == true
    if M.data == 6
        discard(M);
    end
end

Tips

  • Use the isvalid operator to check if a message is valid in a Simulink® model that contains more than one Stateflow® chart.

Introduced in R2018b