Exercise 550
Given a square matrix A and a vector V:
![](https://1.bp.blogspot.com/-srA4HpQdBtE/X2TU_NZQTKI/AAAAAAAAB3Y/tUSpa1EYhfk314ejDKUI8GNBWCkfcIlCwCLcBGAsYHQ/s16000/matrix-vector-numpy-python-courses.png)
Give the Python code numpy which calculates the product AV (the matrix product and not the term to term product)
Solution
import numpy as np
A = np.array([[1,2],
[2,3]])
V = np.array([1,2])
print(np.dot(A,V))
Younes Derfoufi
my-courses.net
my-courses.net