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.

length

Determine length of message queue

Syntax

length(message_name)

Description

example

length(message_name) checks the number of messages in a message queue.

Examples

expand all

Check the queue for message M. If a message is present, remove it from the queue. If exactly seven messages remain in the queue, increment the value of x.

during:
if receive(M) == true
    if length(M) == 7
        x = x+1;
    end
end

Introduced in R2018b