You are on page 1of 2

Practical-6

Aim: Write a program to calculate eigen value and eigen vector (order 2 and order 3)

A)

Code-

import numpy as np

r=int(input("Enter no rows:"))

c=int(input("Enter no cols:"))

print("Enter ",r*c," elements of array:")

A=[[int(input())for j in range(c)] for i in range(r)]

m = np.array(A)

print("Printing the Original square array:\n",m)

w,v = np.linalg.eig(m)

print("Printing the Eigen values of the given square array:\n",w)

print("Printing the Right eigenvectors of the given square array:\n",v)

Output-

1)

2)

You might also like