Error and can't find whats causing index exceed matrix dimension

조회 수: 1 (최근 30일)
liu James
liu James 2016년 12월 28일
댓글: liu James 2016년 12월 28일
I'm getting this:
Index exceeds matrix dimensions.
Error in Test3 (line 51)
if (status == 0) && (a(1) > a(2))
Although it says the line, but I can't find what is actually causing it. All the cells have same dimensions. Please help
  댓글 수: 2
the cyclist
the cyclist 2016년 12월 28일
편집: the cyclist 2016년 12월 28일
What is the calling syntax of the functions?
Also, maybe I missed it, but I don't see any reference to an object called "Test3" in what you uploaded.
liu James
liu James 2016년 12월 28일
Hey Cyclist. thanks for noticing it. The file was left out accidentally.

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 12월 28일
bb{1,5}(:,7) does not match datenumber at all, causing k{5} to be empty, which cases b{5} to be empty, which causes a=b{t} to be empty. Your code assumes a has at least 6 elements.
  댓글 수: 1
liu James
liu James 2016년 12월 28일
Thanks Walter...I just realized that the empty cell caused it to stop. So I added another condition for an empty cell and it just ran. Took me a long time. But Thanks for taking a look.

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

추가 답변 (0개)

카테고리

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