Skip to Main Content Skip to Search
Product Documentation

Determining Whether a Queue Is Nonempty

To determine whether a queue is storing any entities, use this technique:

  1. Enable the #n output signal from the queue block. In the block dialog box, on the Statistics tab, select the Number of entities in queue, #n check box.

  2. From the Math Operations library in the Simulink library set, insert a Sign block into the model. Connect the #n output port of the queue block to the input port of the Sign block.

The Sign block output has values of 0 and 1. A value of 1 indicates that the queue is storing one or more entities. A value of 0 indicates that the queue is not storing any entities.

  


Free SimEvents Evaluation Kit

Learn how you can use SimEvents discrete-event simulation capabilities through these technical resources.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS