不要问我什么是方波,小心川川锤你哦!
代码:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 1000)
y=0
for k in range(1, 10, 1):
y=y+4*np.sin((2*k-1)*x)/((2*k-1)*np.pi)
plt.plot(x,y,'k',color='r',label="w=1",linewidth=3)
plt.axis([0,10,-1.5,1.5])
plt.legend()
plt.show()
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有