Conditional marker on stream time series data plotting
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!