Filter löschen
Filter löschen

How to generate graph at the same time that data is obtained?

3 Ansichten (letzte 30 Tage)
alcides silva
alcides silva am 20 Dez. 2017
Kommentiert: alcides silva am 21 Dez. 2017
How to generate graph at the same time that data is obtained?

Antworten (1)

Matthew
Matthew am 20 Dez. 2017
One thing you can do is add new data to an already existing plot.
figure;
plot(1:10,1:10);
ah = gca;
for loopIX = 11:100
%New Data becomes available
newXValue = loopIX;
newYValue = rand;
%Add the new data to the plot
ah.Children.XData(end+1) = newXValue;
ah.Children.YData(end+1) = newYValue;
end
Note that you may get warnings about the data arrays being sized wrong between the Xdata update and the Ydata update.
  5 Kommentare
Walter Roberson
Walter Roberson am 21 Dez. 2017
alcides silva:
At each time that you have a new point available, call addpoints() on the animatedLine() object, and then call drawnow().
Depending on your needs, you might want to set the 'MaximumNumPoints' option when you create the animatedLine
alcides silva
alcides silva am 21 Dez. 2017
What I was hoping to do, I got with drawnow update or drawnow expose. Great. Thank you so much.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by