필터 지우기
필터 지우기

Animate a plot upon a timer

조회 수: 5 (최근 30일)
Matt
Matt 2014년 12월 2일
답변: Matt 2014년 12월 2일
Hello,
I have an existing array (1st column contains time, 2nd column pressure values), and I would like to plot this in my GUI at a chosen rate (and not using a FOR loop that goes from the 1st row to the last row of the data set).
For example, I would like that when I press a pushbutton in my GUI, the pressure value is plotted against time (the time value in my array), and the plot keeps updating itself until it reaches the max time value in my array or that the user presses another pushbutton to stop the process. The user should then be able to resume the plotting of the data.
I have to add that the sampling rate of my pressure reading was 1000Hz, and that I would like to show the pressure value 2 times per second (this can be 3 or 4, but not more), so let's say 4Hz.
How can I do something like that?

답변 (1개)

Matt
Matt 2014년 12월 2일
Just to make sure, this has to be time dependent, and not computer power dependent, because most of the time you want the plot to be plotted as fast as possible depending on your computational power, while here I would like the plot to be shown upon a fixed time (as I am assuming any computer can run this without any problem).
This is to link then to a video where I will be able to link the time scale of the video with what is shown on my plot, hence why I have to work in the time scale (and not steps scale).

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by