In: Computer Science
Using Python:
Normalize a 5x5 random matrix
hints:
Code
import numpy as np #import numpy
matrix = np.random.random((5,5)) #matrix of 5x5
minimum=matrix.min()
maximum=matrix.max()
print("Before Normalization: ")
print(matrix)
print()
matrix=(matrix-minimum)/(maximum-minimum) #normalization
print("After Normalization: ")
print(matrix)
Terminal Work
.