1: for python position

38

import sys
import numpy as np
import matplotlib.pyplot as plt

y = np.loadtxt('acs712_192us.m')
size = len(y)

x = np.arange(0, size)

out = []

lamb = 0.9 

for i in range(len(y)):
    if i == 0:
       out.append(value) # value is what you want out[0] to be
    else:
        out.append(((1-lamb) * y[i]) + (lamb * out[i - 1]))

plt.plot(x, y)
plt.plot(x, out)
plt.show()

c = a[:3]    # [10, 11, 12]
d = a[2:]    # [12, 13, 14]
e = a[:]     # [10, 11, 12, 13, 14]

Comments

Submit
0 Comments