MATLAB: I’m getting the following error when I try to run some function m-files: Undefined function or method ‘eig’ for input arguments of type ‘intval’.

aicha

I'm getting the following error when I try to run some function m-files: Undefined function or method 'eig' for input arguments of type 'intval'. thank you

Best Answer

>> doc eig
...
Input Arguments
A — Input matrix
square matrix
Input matrix, specified as a real or complex square matrix.
Data Types: double | single
Complex Number Support: Yes
...
Per the documentation, eig doesn't accept anything except floating point inputs...use
E=eig(double(YourIntegerArray));