Mathedu Courses logo

Mathedu Courses

If you see this, something is wrong

Table of contents

First published on Sunday, Aug 30, 2026 and last modified on Tuesday, Sep 1, 2026

Lecture 4 - Solve a Square Matrix Equation in Python

Fabienne Chaplais Email

1 Lecture 4

from numpy import *
from numpy.linalg import *
from matplotlib.pyplot import *
A=random.randn(10,10)
imshow(A)
title('Matrix A')
B=random.randn(10,1)
X=solve(A,B)

figure()

subplot(1,2,1)
imshow(B)
title('Column vector B')

subplot(1,2,2)
imshow(A@X)
title('Product AX')

Discussion: login to participate.