0

Matrix determinant calculation?

I need to write a function which generate a random matrix (bigger than 2x2). And calculate all the 2x2 part determinant of the generated matrix and generate a new matrix with that values.

16th Apr 2021, 11:06 AM
account gamer
account gamer - avatar
7 odpowiedzi
+ 2
Show your attempt first
16th Apr 2021, 11:42 AM
Atul [Inactive]
16th Apr 2021, 4:28 PM
Atul [Inactive]
+ 1
For bigger numbers you have to take bigger inputs
16th Apr 2021, 1:29 PM
Atul [Inactive]
+ 1
Hope this helps you
16th Apr 2021, 4:28 PM
Atul [Inactive]
0
arr = np.random.randint(1,10,(3,3)) matrix = np.zeros((3,3)) matrix[0][0] = int(np.linalg.det(arr[0:2,0:2])) matrix[0][1] = int(np.linalg.det(arr[0:2,1:3])) matrix[1][0] = int(np.linalg.det(arr[1:3,0:2])) matrix[1][1] = int(np.linalg.det(arr[1:3,1:3]))
16th Apr 2021, 1:03 PM
account gamer
account gamer - avatar
0
That's what i tried, but it works only on a 3x3 matrix. How can i edit this code to work on a different size of matrix? For example 4x5 or 7x7 or 16x16? Thanks for your help.
16th Apr 2021, 1:04 PM
account gamer
account gamer - avatar
15th Oct 2023, 10:50 AM
Gagan Sahay
Gagan Sahay - avatar