MATLAB: Matrix multiplication error multiplication Hi all, i'm doing matrix multiply and array multiply but it gives me NaN matrix what can be the reason for that? this is the equation a=xv*eye(n).*xv thanks in advance. Best Answer You could get NaN if you multiply infinity by 0. Once you have one NaN, it very often "pollutes" all the other calculations. Related SolutionsMATLAB: Correlation between two row matrices Like that, each value of "a" is correlated to each value of "b", but applying the formula of the correlation, the correlation of two single numbers is NaN. To compute the correlation correctly, traspose the input vectorsresult = corr(a', b'); MATLAB: How to count non nan values nnz(~isnan(vec))where vec is the vector (it could even be a matrix or ND array). Related QuestionSame matrix but not equal problemHow to find peaks along a dimension in a 3d matrixIs this a bug in double precision data typeScalar multiplication of two vectors giving me NAN,both are of same dimensions.Finding values of specific range from table row or column
Best Answer