Array indices must be positive integers or logical values.ERROR
조회 수: 1 (최근 30일)
이전 댓글 표시
for d=0:5:50
Pl=40*log(d)-(10*log(gt)+10*log(gr_s)+20*log(ht)+20*log(hr));
Rss= pt+gt+gr_s-L50-L;
SNIR= Rss/n+I;
c=B*log(1+SNIR);
throuput1=(c(B*log(1+SNIR)));
end
댓글 수: 0
답변 (2개)
Walter Roberson
2019년 11월 12일
c(B*log(1+SNIR)) is a request to index the variable c at the computed value. MATLAB does not have any implicit multiplication: if you want multiplication you need the * or .* operator.
댓글 수: 0
David Hill
2019년 11월 12일
throuput1=(c*(B*log(1+SNIR)));%I think you left out a * (c*...) otherwise you are trying to index into c
Also, log(0) will be -inf. Do you want to start out at d=0?
댓글 수: 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!