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
matlab中使用正弦波合成方波(带动画),布布扣,bubuko.com
时间: 2024-10-14 16:42:31
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
matlab中使用正弦波合成方波(带动画),布布扣,bubuko.com