Generation

generate functionThu, 30 Mar 2023

There is a matrix A1 = array([[0, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 0, 1]]) Multiply the vector vector = [1,2,3,4] by the matrix A1

import numpy as np A1 = np.array([[0, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0], [0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 0, 1]]) vector = [1,2,3,4] A1.dot(vector)

Questions about programming?Chat with your personal AI assistant