value = get(t, 'PropertyName')
values = get(t)
| Parameter | Description |
|---|---|
| t | Timer object. Use a scalar timer when requesting all properties. |
| PropertyName | Name of the property to query. |
| Parameter | Description |
|---|---|
| value | Requested property value. |
| values | Scalar structure containing the timer property values. |
get returns the value of a named timer property. Calling get with only a scalar timer returns a structure containing all timer properties, including read-only properties such as Running, TasksExecuted, AveragePeriod, and InstantPeriod.
t = timer('Name', 'getExample', ...
'StartDelay', 0.2, ...
'TimerFcn', @(src, event) disp('done'));
delay = get(t, 'StartDelay')
props = get(t)
delete(t);
t = timer('ExecutionMode', 'fixedSpacing', ...
'Period', 0.05, ...
'TasksToExecute', 2, ...
'TimerFcn', @(src, event) disp('tick'));
start(t);
wait(t);
executed = get(t, 'TasksExecuted')
delete(t);
| Version | Description |
|---|---|
| 2.0.0 | initial version |