Conditional marker on stream time series data plotting
Afficher commentaires plus anciens
I like to mark in a stream time series data when data value equals to a threshold. Whenever such value is reached in a streaming time series plot the marker will appear and then streaming will go on with the marker. I have modified code from http://www.mathworks.in/matlabcentral/answers/87466-real-time-plot-from-streaming-data as:
t = 0 ; x = 0 ; startSpot = 0; interv = 1000 ; % considering 1000 samples step = 0.1 ; % lowering step has a number of cycles and then acquire more data while ( t <interv ) b = sin(t)+5; x = [ x, b ]; plot(x) ; if ((t/step)-500 < 0) startSpot = 0; else startSpot = (t/step)-500; end axis([ startSpot, (t/step+50), 0 , 10 ]); grid t = t + step; drawnow; pause(0.01) end
But this is not working as intended????
1 commentaire
per isakson
le 5 Mar 2014
Try to markup the code. Select the code and click the button [{}Code].
Réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!