Documentos de Académico
Documentos de Profesional
Documentos de Cultura
pyplot as plt
import numpy as np
t=np.linspace(-10,10,1000)
def x(i):
if i >= 0:
j = 1
else:
j = 0
return j
y = []
for i in t:
y.append(x(i))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
y.append(1 - abs(i) / 3)
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
y.append(exp(-2 * abs(i)))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
y.append(sin(6 * i) / (6 * i))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
y.append(2 * cos(2 * pi / 7 * i))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
y.append(3 * sin(2 * pi / 5 * i))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
j = i
while j >= 2 * pi:
j = j - 2 * pi
if j <= 0.65 * 2 * pi:
y.append(1)
else:
y.append(0)
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
j = i
while j >= 2:
j = j - 2
if j >= 0 and j <= 1:
y.append(sin(pi * j))
else:
y.append(0)
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()
y = []
for i in t:
j = i
while j >= 1.5:
j = j - 1.5
if j >= 0 and j <= 1.5 / 2:
y.append(sin(2 * pi / 1.5 * j))
else:
y.append(-sin(2 * pi / 1.5 * j))
plt.grid()
plt.plot(t,y)
plt.ylabel('y')
plt.xlabel('t')
plt.show()