Matlab Codgen eig() function - strange behaviour
First, don't be fooled by the long post, there is not a lot of code just an observation of results so there are few example matrices. This is a bit related to this question: Matlab Codegen Eig Function - Is this a Bug? I know that mex/C/C++ translated eig() function may not return the same eigenvectors when using the same function in MATLAB and that's fine, but i am puzzled with results I'm getting. First this simple example: Output % c = diagonal matrix of eigenvalues % b = matrix whose columns are the corresponding right eigenvectors function [ b, c ] = eig_test(a) [b, c] = eig(a); end