Matlab创建多个动画线条 animatedline
Matlab创建多个动画线条 animatedline
·
figure('Color','w');
h1 = animatedline;
h1.Color = 'r';
h1.LineWidth = 1.0;
h1.LineStyle = '-.';
h2 = animatedline;
h2.Color = 'b';
h2.LineWidth = 1.0;
h2.LineStyle = '-';
axis([0,4*pi,-1,1])
x = linspace(0,4*pi,1000);
y1 = sin(x);
y2 = cos(x);
for k = 1:length(x)
addpoints(h1,x(k),y1(k));
addpoints(h2,x(k),y2(k));
drawnow;
end
更多推荐
已为社区贡献1条内容
所有评论(0)