ShinkarenkoVA 4 дней назад
Родитель 1e45e84775
Сommit 4b903bc3af

@ -362,7 +362,6 @@ for mm in func5(7,3):
7
alp=func5(7,3)
print(alp.__next__())
1
print(alp.__next__())
4
print(alp.__next__())

@ -0,0 +1,17 @@
import matplotlib.pyplot as plt
from module1 import *
yval = []
fp = open('test.txt', 'w')
for i in gen(-4, 5, 1, a, b, T):
fp.write(str(i[0]) + '\n')
fp.close()
fp = open('test.txt', 'r')
for x in fp:
yval.append(float(x.rstrip('\n')))
fp.close()
plt.plot(yval)
plt.show()

@ -0,0 +1,12 @@
import math
a = 2
b = -6
T = 1.5
anfun = lambda a, b, x, T: a*math.sin(x)+b*math.cos(x+T)
def gen(start, fin, shag, a, b, T):
x = start
while x <= fin:
yield [anfun(a, b, x, T)]
x += shag
Загрузка…
Отмена
Сохранить