Say I have a 3×3 matrix, I want to plot the 3 columns in animation. Meaning plotting the column values 1 after the other. Any idea please. Thanks for the help.
You can use thecomet() function if you manipulate the data a bit.
x=[0:1:10];
a=[0 1 0 1 0 1 0 0 1 1 0];
xq=0:0.01:10;
aq = interp1(x,a,xq,'previous');
comet(xq,aq)
There is also a similar function calledanimatedline() which I have never tested. Or as a third, perhaps simplest solution, plot point-by-point in a for-loop usingpause(t) in every loop.
Best Answer