Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- x = [1,2,3,4,5]
- y = [0.873,1.14,1.246,1.289,1.305]
- plt.plot(x,y,'ro')
- plt.axis([0,5,0,3])
- z = np.polyfit(x,y,1)
- p = np.poly1d(z)
- plt.plot(x,y,'ro',x,p(x),'r--')
- plt.ylabel("Volts")
- plt.xlabel("Tau")
- plt.title("Capacitor Charging")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment