From: Stefano pioli on
I have a function that uses the PLOT to make a fast forward effect, it works correctly. I want this same function uses multiple columns of the same array, together with the plot and out of phase with y-axis, then all together to make the fast forward effect. This code will be part of a GUI, plotting on axes. I am attaching the code "one-dimensional" working and the not working.

Thanks Stefano

=============================OK==============
x=rand(500);
y=x(1:51);
line=linspace(1,length(y)+1,length(y));
h=plot(line,y);
grid off
set(h,'EraseMode','xor','MarkerSize',18)
for t=1:1:450
e=t+50;
drawnow
y=x(t:e);
set(h,'YData',y)
pause(0.05)
if (str2num(get(handles.text1,'String'))==1) %<---exit
set(handles.edit2,'String',num2str(e));
break
end
end
===========================NOT=OK============
x=rand(500,3);
y=x(1:51,1);
line=linspace(1,length(y)+1,length(y));
h=plot(line,y);
grid off
set(h,'EraseMode','xor','MarkerSize',18)
for t=1:1:450
for i=1:3
e=t+50;
drawnow
y=x(t:e,i)+(2*i);
set(h,'YData',y)
pause(0.05)
end
if (str2num(get(handles.text1,'String'))==1) %<---exit
set(handles.edit2,'String',num2str(e));
break
end
end