Generation

generate functionTue, 10 Jan 2023

Solve the system of equations with numpy and linalg: 4x + 2y + z = 4 x + 3y = 12 5y + 4z = -3

import numpy as np def system_solver(a, b, c, d, e, f): return np.linalg.solve(a, b) a = np.array([[4, 2, 1], [1, 3, 0], [0, 5, 4]]) b = np.array([4, 12, -3]) system_solver(a, b)

Questions about programming?Chat with your personal AI assistant