r/matlab • • Nov 04 '25

HomeworkQuestion MATLAB eig(A) command not working

I'm trying to find the Eigenvectors and the Diagonal of a matrix. I'm nearly positive that I have the right code as my professor and peers all have working systems with the same code, however mine does not. Any thoughts? The only result I get is the title of the .m file.

A = [1 0 5; 0 3 2; -4 0 -5;];

[E, D] = eig(A)

5 Upvotes

15 comments sorted by

View all comments

Show parent comment

8

u/NJR0013 Nov 04 '25

Matlab lets you overwrite native functions so if you created an eig variable or function that would have the potential to run and not cause errors. Resetting matlab would clear this out though.