matlab中使用正弦波合成方波(带动画)


x=0:0.1:6*pi; 

for step=1:2:100 
s=0; 
for i=1:2:step 
s = s+1/i*sin(i*x); 
end 
plot(s);set(figure(1),'visible','off'); 
filename=[num2str(step, '%04d'),'.png']; 
print(1, '-dpng',filename); 

end

GibbsPhenomenon

posted @ 2014-06-27 12:20  Craftor  阅读(8976)  评论(0编辑  收藏  举报