MATLAB: Dot product function in Matlab

dot

Hello, I just tried to do in Matlab :
I=eye(3)
dot(I,I)
–> the result is [1 1 1]
To my understanding it clearly should be [0 0 0] !!! Why does it produce 1 1 1 ?
Best regards, OD
(P.S. It works correctly with other e.g. random matrices)

Best Answer

dot(A,B), for N-D arrays A and B, returns the scalar product
along the first non-singleton dimension of A and B. A and B must
have the same size.
>> dot(I(:,1),I(:,1))
ans =
1