What does this error mean?

4 visualizaciones (últimos 30 días)
Rebekka Klara Gasser
Rebekka Klara Gasser el 7 de Oct. de 2015
Comentada: Rebekka Klara Gasser el 7 de Oct. de 2015
I get an error when calling the eig() function.
First I thought my matrix is somehow 'bad' for computing the eigenvalues.
But even if I just type
eig(eye(4))
I get the following error:
"Subscript indices must either be real positive integers or logicals."

Respuesta aceptada

Titus Edelhofer
Titus Edelhofer el 7 de Oct. de 2015
Hi,
this means, that using eye(4) is not valid for indexing (which is true, since it contains zeros). This implies, that you have a variable named eig, that shadows the function.
whos eig
probably tells you that eig is a variable. Remove it
clear eig
and then eig(eyes(4)) should do what you expected.
Titus
  1 comentario
Rebekka Klara Gasser
Rebekka Klara Gasser el 7 de Oct. de 2015
Ah I see!
You're right. I named a variable 'eig' which was not really clever.
Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by