close all;
clc;clf;
%白色背景
axis([-2,2,-2,2]);
xlabel('X轴');
ylabel('Y轴');
%四周的边框
box on;
%绘图区域
t=0:0.05:10;  
Nt=size(t,2);
%循环绘图
m=1;
directpath='G:\fatigue_exm033\';
for i=1:Nt
    tt=m*100;
    fprintf('tt=%d\n',tt);   
    if tt>160000
        break
    end
    cla;
    hold on;
    str1=[directpath,'sttrx',num2str(tt),'.mat'];
    load(str1,'sttrx')
    scatter_color(dotall(1:allnum,:),sttrx(:,1))
    frame=getframe(gcf);
    imind=frame2im(frame);
    [imind,cm] = rgb2ind(imind,256);
    m=m+1;
    if i==1
         imwrite(imind,cm,'BBPD.gif','gif', 'Loopcount',inf,'DelayTime',1e-4);
    else
         imwrite(imind,cm,'test.gif','gif','WriteMode','append','DelayTime',1e-4);
    end
end