MATLAB Answers

how to get rid of the following error

1 ビュー (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2017 年 12 月 29 日
回答済み: Jan 2017 年 12 月 30 日
throughput_E = Bmax*log2(1+p_fix(t)*gamma(t)/symsum(p_fix(q,1,t-1).*gamma(t)))
If i run the code i am getting Subscript indices must either be real positive integers or logicals.
Error in throughput_E =Bmax*log2(1+p_fix(t)*gamma(t)/symsum(p_fix(q,1,t-1).*gamma(t)))
  1 件のコメント
KSSV 2017 年 12 月 29 日
Related to this: In that link your code is not you are getting a different error. :(


回答 (2 件)

Bibhu Das
Bibhu Das 2017 年 12 月 29 日
This kind of error is appearing may be because of the q value defined. If the q value at t-1 becomes negative or zero and the function is unable to take negative value. Hope it gives some help. Thanks.

Jan 2017 年 12 月 30 日
You have redefined a function by an array. Maybe this is "gamma", "log2", "p_fix" or "symsum". Without seeing the complete code, it is impossible to guess, which of these symbols cause the problem. But you can use the debugger to find this information. Please debug your code by your own before you ask the forum.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by