function AnimateBridge(y) %Animates the Tacoma Narrows Bridge from the solution to the differential %equation, y. Time is assumed to be varying by a fixed step h... % % Length (len) is fixed at 6 below and in the ODEs % clf % clear figure window len=6; set(gca,'XLim',[-8 8],'YLim',[-8 8], 'XTick',[-8 0 8],'YTick',[-8 0 8], ... 'Drawmode','fast','Visible','on','NextPlot','add'); cla; % clear screen axis square % make aspect ratio 1 - 1 road=line('color','b','LineStyle','-','LineWidth',5,'erase','xor','xdata',[],'ydata',[]); lcable=line('color','r','LineStyle','-','LineWidth',1,'erase','xor','xdata',[],'ydata',[]); rcable=line('color','r','LineStyle','-','LineWidth',1,'erase','xor','xdata',[],'ydata',[]); [mm,nn]=size(y); %y should be tall, nn should be 4 if mm