1 Comment
User's avatar
Orith Loeb's avatar

Hello,

Here's my solution:

# DDC-50: Singular values of a diagonal matrix

import numpy as np

mat = np.zeros((5,8))

for i in range (0,5):

for j in range (0,5):

if i == j:

mat [i,j] = (i+1)**2

print (mat)

U, s, Vh = np.linalg.svd (mat)

print (s)

Expand full comment