How to generate graph at the same time that data is obtained?
2 views (last 30 days)
Matthew on 20 Dec 2017
One thing you can do is add new data to an already existing plot.
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;
Note that you may get warnings about the data arrays being sized wrong between the Xdata update and the Ydata update.