Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Getting the error:Subscript indices must either be real positive integers or logicals.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi I am trying to run:
theq=thetav(min(abs(c-dcv))); but it gives me this error: Subscript indices must either be real positive integers or logicals.
I even tried to to do something like:
A=abs(c-dcv); theq=thetav(min(A));
it still says the same.
c is a 1x1 double and dcv is a 100x1 double.
Would appreciate any advice on fixing this.
Thanks,
댓글 수: 1
답변 (1개)
dbmn
2017년 2월 6일
The problem is, that you try to access the 4.275th (or smth) element of thetav. You can only access Elements 1 to infinity (indexing).
This wont work:
theq=thetav(4.75);
but this will:
theq=thetav(4);
You should try to reference by indices. For example with
theq=thetav(A==min(A));
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!