fig = findall(0,'Type','figure','Tag','fff');
if isempty(fig)
fig = figure('MenuBar','none','Name','NNN','NumberTitle','off',...
'BackingStore','off','Tag','fff','ResizeFcn','res(...);',...
'Position',[150 20 1000 900]);
% add some UI elements to control calculations
ax = findall(fig,'Type','axes');
if isempty(ax)
ax = axes('Parent',fig,'Box','on','TickDir','out','XGrid','on','YGrid','on',...
'Units','pixels','Position',[100 30 pp(3)-130 pp(4)-60],'Color','k',...
'XColor',repmat(0.3,1,3),'YColor',repmat(0.3,1,3),'ZColor',repmat(0.3,1,3),...
'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1],...
'XLim',[-pi pi],'YLim',[-1 1]);
end
for i=1:n
hln(i) = line('Parent',ax,'color',col(i,:),'Marker','.',...
'MarkerSize',mmsize(m(i)),'XData',r(1,i),'YData',sin(r(2,i)),...
'Erase','xor','LineWidth',1);
end
else
% find lines...
end
while ishandle(fig) && t(end)<tlim
% calc data
for i=1:n
set(hln(i),'XData',r(1,i),'YData',r(2,i),'ZData',r(3,i));
end
end