Borrar filtros
Borrar filtros

dot product function in Matlab

4 visualizaciones (últimos 30 días)
AD
AD el 27 de Dic. de 2016
Movida: John D'Errico el 25 de Nov. de 2023
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,
(P.S. It works correctly with other e.g. random matrices)

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Dic. de 2016
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
  1 comentario
AD
AD el 27 de Dic. de 2016
Movida: John D'Errico el 25 de Nov. de 2023
or sorry .. I made a mistake ... what I did was useless, I was projecting it on itself - so to speak.
projecting each vector on himself gives his own norm

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by