Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import numpy as np
- import matplotlib.pyplot as plt
- # Задание 1
- A = [[1, 2, 3],
- [3, 5, 6],
- [7, 8, 9]]
- b = [1, 3, 5]
- x = np.linalg.tensorsolve(A, b)
- ver = A*x - b # Проверка не работает 0.о
- # Задание 2
- # Создаем матрицу в экселе
- # Импортируем матрицу сюда
- array = np.loadtxt("Z:\Матлаб\Матрица_5x5.csv", delimiter=';', dtype='int')
- reverse = array^(-1)
- np.savetxt("Z:\Матлаб\Матрица_5x5_new.csv", reverse, delimiter=';')
- # Задание 3
- polynom = [3, 0, 0, 1]
- roots = np.roots (polynom)
- t1 = np.arange(0.0, 5.0, 0.01)
- plt.figure(1)
- plt.subplot(311)
- plt.title('First graph')
- plt.plot(t1, np.exp(-t1) * np.cos(2*np.pi*t1))
- plt.figure(1)
- plt.subplot(312)
- plt.title('Second graph')
- plt.plot(t1, np.exp(-t1) * (np.sin(np.pi*t1)))
Advertisement
Add Comment
Please, Sign In to add comment