How should I update the data of a plot in Matlab?
Short answer : always use Set(‘Xdata’,…’). Example code: function PlotUpdate() x = 0:.1:8; y = sin(x); h = plot(x,y); y = sin(x.^3); set(h,’XData’,x,’YData’,y); end Long answer: There are three relevant measures by which one should choose the best method. Code clarity – How easy it is for someone to read your code? Runtime – How … Read more