Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f6a00fd

Browse filesBrowse files
committed
updated matrix_inversion.py
1 parent b67bb57 commit f6a00fd
Copy full SHA for f6a00fd

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
2-
from matrix_utils import get_square_matrix
2+
from matrix_utils import determine_matrix
3+
34

45
def compute_inverse(matrix):
56
try:
@@ -8,11 +9,11 @@ def compute_inverse(matrix):
89
except np.linalg.LinAlgError:
910
raise ValueError('The matrix is not invertible because its determinant is zero.')
1011

11-
matrix = get_square_matrix()
12+
matrix = determine_matrix(square_matrix=True)
1213

1314
try:
1415
inverse_matrix = compute_inverse(matrix)
1516
print(f'Matrix: {matrix}')
1617
print(f'Inverse matrix: {inverse_matrix}')
1718
except ValueError as e:
18-
print(f'An error occurred {e}')
19+
print(f'An error occurred {e}')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.