Index Exceeds Matrix Dimensions

1 visualización (últimos 30 días)
Samuel Jubon
Samuel Jubon el 19 de Sept. de 2019
Editada: James Tursa el 19 de Sept. de 2019
I have had problems with both cross products and dot products in MatLab but have no clue why these issues are occurring. I have attempted this in both 2018b and 2016a when it did not work in 2018b.
I want to take the dot product of two vectors but repeatedly get the Index Exceeds Matrix Dimensions error when I run the script.
r=[2.1,-1.8,0];
v=[.4,0,.4];
dot(r,v)

Respuestas (1)

James Tursa
James Tursa el 19 de Sept. de 2019
Editada: James Tursa el 19 de Sept. de 2019
You have inadvertantly created variables named "dot" and "cross" that are shadowing the MATLAB functions of the same names. Change the variables to different names. To verify this,
which dot
which cross
  1 comentario
Samuel Jubon
Samuel Jubon el 19 de Sept. de 2019
Thank you, that worked! I appreciate your help.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by