What does s() mean?
本问题已经有最佳答案,请猛点这里访问。
我不明白
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import numpy as np import matplotlib.pyplot as plt import scipy.signal as sps import scipy.interpolate as spi # plot cubic cardinal B-spline (knots 0, 1, 2, 3, 4) p = 3 xx = np.linspace(0, p+1, 100) yy = sps.bspline(xx - (p+1)/2, p) plt.plot(xx, yy) plt.show() # plot cubic non-uniform spline (m=5 DOFs) xi = [0, 1, 3, 4, 6, 7, 8, 10, 11] c = [2, -1, 1, 0, 1] s = spi.BSpline(xi, c, p) m = len(c) xx = np.linspace(xi[p], xi[m]) yy = s(xx) plt.plot(xx, yy) plt.show() |
我试着运行
这是你程序中的
看,它来自上面几行:
1 | s = spi.BSpline(xi, c, p) |
1 | s(xx) |