Walter Roberson <firstname.lastname@example.org> wrote in message <2DSIo.284$Ny7.email@example.com>... > On 26/11/10 8:23 AM, Markus Due Jakobsen wrote: > > > Is it possible to reference a vector to a plot without constantly > > re-setting the plot settings i.e. ‘xdata’ and > > ‘ydata’? > > Newish versions of Matlab offer the ability to set the X Data Source and > Y Data Source to variables -- though you might have to call the > refresh() function to activate the changes.
Thanks a lot for your reply, this was very helpful. However, the refreshdata method doesn’t seem to work with multiline plots.
%% Example: y = rand(100,3); h = plot(y); set(h,'YDataSource','y'); pause(1) y=y(1:10,:); refreshdata(h); >> ??? Error using ==> refreshdata at 58 >> Could not refresh YData from 'y'.
How can this be and is there a way to work around it?