Index Exceeds Matrix Dimensions

조회 수: 1 (최근 30일)
Samuel Jubon
Samuel Jubon 2019년 9월 19일
편집: James Tursa 2019년 9월 19일
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)

답변 (1개)

James Tursa
James Tursa 2019년 9월 19일
편집: James Tursa 2019년 9월 19일
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
Samuel Jubon
Samuel Jubon 2019년 9월 19일
Thank you, that worked! I appreciate your help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by