Main Content

isLocked

Determine if System object is in use

Description

tf = isLocked(obj) returns logical 1 (true) if the System object is in use. Otherwise, isLocked returns logical 0 (false).

The object performs an internal initialization the first time that you call the object. After initialization, the object is considered in-use and you cannot change nontunable properties and other specifications determined by the System object author. While an object is in use, isLocked returns 1 (true). To allow changes to the object, call release.

example

Examples

collapse all

Create a Counter object and set a property.

obj = Counter;
obj.UseIncrement = false
obj = 
  Counter with properties:

    UseIncrement: false
    UseWrapValue: true
      StartValue: 1
       Increment: 1
       WrapValue: 10

Call the object.

step(obj,1)
ans = 
2

Check if the object is in use.

isLocked(obj)
ans = logical
   1

Release the object and check if the object is still locked.

reset(obj)
release(obj)
isLocked(obj)
ans = logical
   0

Input Arguments

collapse all

System object whose status you want to query.

Output Arguments

collapse all

True or false result, returned as logical 1 or 0 indicating the status of the System object as in use (locked) or not.

Extended Capabilities

Version History

Introduced in R2010a