The code sample I have below links data to a plot, and then starts modifying the data. The problem is that the plot never refreshes during the for loop. The linked plot only refreshes after the program is done.
Calling refreshdata in the for loop is not an option, because it takes too long and breaks the flow of the program. Any ideas on what I could do/try? I need for the plot to update every few seconds without breaking program flow.
clear allclose allt = [0];y = [0];figureh = plot(t,y);set(h,'XDataSource','t');set(h,'YDataSource','y');linkdata onfor i = 1:50 t(i) = i; y(i) = sin(i) % refreshdata
pause(.1)end
Best Answer