Skip to Main Content Skip to Search
Product Documentation

get (timer) - Timer object properties

Syntax

get(obj)
V = get(obj)
V = get(obj,'PropertyName')

Description

get(obj) displays all property names and their current values for the timer object obj. obj must be a single timer object.

V = get(obj) returns a structure, V, where each field name is the name of a property of obj and each field contains the value of that property. If obj is an M-by-1 vector of timer objects, V is an M-by-1 array of structures.

V = get(obj,'PropertyName') returns the value, V, of the timer object property specified in PropertyName.

If PropertyName is a 1-by-N or N-by-1 cell array of strings containing property names, V is a 1-by-N cell array of values. If obj is a vector of timer objects, V is an M-by-N cell array of property values where M is equal to the length of obj and N is equal to the number of properties specified.

Examples

t = timer;
get(t)
       AveragePeriod: NaN
            BusyMode: 'drop'
            ErrorFcn: ''
       ExecutionMode: 'singleShot'
       InstantPeriod: NaN
                Name: 'timer-1'
    ObjectVisibility: 'on'
              Period: 1
             Running: 'off'
          StartDelay: 1
            StartFcn: ''
             StopFcn: ''
                 Tag: ''
       TasksExecuted: 0
      TasksToExecute: Inf
            TimerFcn: ''
                Type: 'timer'
            UserData: []
get(t, {'StartDelay','Period'})
ans = 

    [0]    [1]

See Also

set(timer) | timer

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


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