How To Make a 10x10 Matrix Diagonalization Calculator

My Code goes like this it's a working 2x2 Diagonalization Calculator but I need to be able to do a 10x10 matrix
prompt = 'Enter Matrix format [Row;NextRow] ';
GivenMatrix = input(prompt)
EigenValues = eig(GivenMatrix)
[V,EV] = eig(GivenMatrix)
Polynomial = poly(GivenMatrix)
A = V(:,1)
B = V(:,2)
AN = A/V(:,1)
BN = B/V(:,2)
EigenVector = AN+BN
Inverse = inv(EigenVector)
ANS = Inverse*GivenMatrix*EigenVector
I tried to increase the number of variables but when i tried to use them they always give me inaccurate answers. I also tried doing a 3x3 version but always messes up the eigenvector part of the solution

3 comentarios

Jan
Jan el 2 de Dic. de 2017
You forgot to mention, what you want as result. The input is a 10x10 matrix (of course provided by code, not by an input command!), but what is the wanted output?
The 10x10 matrix must be inputted and as for the result It should be the diagonalized vector
Jan
Jan el 4 de Dic. de 2017
It is a challenge to input 100 numbers in an edit field correctly. One typo and you have to restart. In consequence it is not trivial to reproduce a result.

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 4 de Dic. de 2017
Why is
[V, EV] = eig(A)
not a solution of the problem already? Or:
roots(poly(A))
?

Categorías

Más información sobre Linear Algebra en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Dic. de 2017

Respondida:

Jan
el 4 de Dic. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by