Index exceeds matrix dimensions
조회 수: 1 (최근 30일)
이전 댓글 표시
Can't seem to figure out what's wrong with this code. The error points to the 3rd line of code here:
for ele = 1:n
for i=1:4
x(i,1)=xc(elems(ele,i),1);
y(i,1)=yc(elems(ele,i),1);
end
end
In case you're wondering, here are the sizes of all matrices involved:
x: 4x1
y: 4x1
xc: 2601x1
yc: 2601x1
elems: 2500x4
Also, the highest value returned by elems(ele,i) is 2601 and the lowest is 1 . Everything else is an integer between 1 and 2601, which are all permissible indices for xc. Any thoughts on this?
댓글 수: 3
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!