Subscript indices must either be real positive integers or logicals.
조회 수: 3 (최근 30일)
이전 댓글 표시
I entered this code in matlab:
for k=0:1:4;
t0=0
t(k+1)=t(k)+2;
q(t(k))=(-1)^k;
end
but i get this error. Subscript indices must either be real positive integers or logicals.
can someone please help me' Thanks
댓글 수: 0
답변 (1개)
Star Strider
2017년 4월 10일
The problem is that 0 is not a positive integer:
for k=0:1:4
You need to re-define your index variables or subscript references.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!