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.


Determine if System object is in use


tf = isLocked(obj)



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.


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.

ans = 2

Check if the object is in use.

ans = logical

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

ans = logical

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

Introduced in R2010a