Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Print the norm of a vector and a matrix using numpy.

# import library
import numpy as np
 
# initialize matrix
mat = np.array([[ 1, 2, 3],
               [4, 5, 6]])
 
# compute norm of matrix
mat_norm = np.linalg.norm(mat)
 
print("Matrix norm:")
print(mat_norm)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Print #norm #vector #matrix
ADD COMMENT
Topic
Name
6+6 =