function [ret,x0] = pendan(t,x,u,flag,RefBlock)
%PENDAN S-function for making pendulum animation.
%
%       See also: PENDAN.C, PENDDEMO, PENDSETS and PEND0.

%	Copyright (c) 1990-94 by The MathWorks, Inc.

% Plots every major integration step, but has no states of its own
if flag==0,
   pend0(RefBlock);
   x0 = [];
   ret = [0 0 0 3 0 0];
elseif (flag==2) & (rem(t,0.1)<1e-8)
   [flag,fig] = figflag('Pendulum Visualization',1);
   if flag,
      ud = get(fig,'UserData');
      pendsets(t,ud,u);
   end;
   ret = [];
else
   ret = [];
end

% end pendan
