|
别人的问题,记录一下。
- clear all
- clc
- clf
- %% outline
- % 4 LYR anim points
- %% main
- x = -pi:0.1:2*pi;
- y = sin(x)+0.04*x;
- n_p = length(x);
- n_int = 6;
- col_mm = cool(n_int);
- n_end = 1;
- con = 1;
- h=figure(1);
- set(gca,'XLim',[-4 7],'yLim',[-1.2 1.2]);
- while n_end < n_p
-
-
- ind = 1 : n_end;
- plot(x,y,'color','none');
- axis([-4 7 -1.2 1.2])
- % plot gray point
- hold on
- plot(x(ind),y(ind),'o','markerfacecolor',[0.8 0.8 0.8],'markeredgecolor','none');
- if n_p - n_end > n_int
- n_plot = n_int;
- else
- n_plot = n_p-n_end;
- end
- % plot color points
- for i = 1: n_plot
- plot(x(n_end+i),y(n_end+i),'o','markerfacecolor',col_mm(i,:),'markeredgecolor','none')
- pause(0.05)
- if con < 10
- con_str = ['0',mat2str(con)];
- else
- con_str = mat2str(con);
- end
- fi_na = ['file_imgs/file_sin/fig_',con_str,'_',mat2str(i)];
- fun_work_li_035_myfig_out(h,fi_na,3);
- % mod code here and save your imgs with diff name
- end
-
- % update n_end and plot cont
- n_end = n_end + n_int;
- con = con +1;
- hold off
- pause(0.2)
- end
- %% logs
- % mod : 08-May-2020 13:22:05
复制代码
|
|