Displaying Timer Function in Graph
Show older comments
Hi,
I have created a timer function, which after every second displays EEG data coming through.
I want this to be displayed in a graph not in the command window. How is this possible? Currently it displays the text in the command window
The code is attached
1 Comment
Geoff Hayes
on 25 Feb 2017
Edited: Geoff Hayes
on 25 Feb 2017
sufyan - your code is simply
plot(handles.graph, handles.data, handles.timer)
t = timer('TimerFcn',{@timerCallback,handles},...
'Period',2,'ExecutionMode','fixedRate');
start(t)
function timerCallback(myTimerObj, ~, handles)
size(handles.data)
handles.timer = t
and so it is unclear how it is all related. Where is the EEG data coming from? Is it the handles.data? Note that you don't want to be passing in handles as an input to the timer callback since this is a copy of the handles structure and so won't have any of its fields updated. Instead you will want to pass in the handle to the figure so that you can get the handles from that.
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!