python

수꿍이 suwoniwonni at gmail.com
Sat Oct 10 09:54:10 EDT 2020


import numpy as np
import matplotlib.pylab as plt
x = [1, -2 , 1]; h = [1 , 2 , -1 , 0 , 3 , 1];
nx = nx=[0,1,2]; nh =[0,1,2,3,4,5]
y = np.convolve(x ,h)
ny = np.arange(nx[0] + nh[0], nx[-1] + nx[-1]+1,nx[1]);
print(ny,y)
plt.subplot(1,1,1); plt.stem(y)
plt.subplot(1,1,1); plt.stem( ny, y)

ValueError: x and y must have same first dimension, but have shapes (5,) and (8,)
-whan can i do?? please comment please ㅠㅠ


More information about the Python-list mailing list