Main Content


Class: matlab.DiscreteEventSystem
Package: matlab

Define last-in last-out (LIFO) queue storage




storage=queueLIFO(entityType,capacity) defines a LIFO queue storage element. Use this function when implementing the getEntityStorageImpl method.

Input Arguments

expand all

Type of entities that the new storage element works with.

Maximum number of entities that the storage can contain, specified as a double.

Output Arguments

expand all

Queue storage that contains entities and sorts them in a LIFO order.


expand all

Define LIFO queue storage.

% Define a storage element as a LIFO queue
% - Entities in the queue are sorted in Last-In-First-Out (LIFO) order
% - Queue can store entities of type 'myEntity'
% - Queue can store no more than 25 entities
storage = obj.queueLIFO('myEntity', 25);
Introduced in R2016a