Subscript indices must either be real positive integers or logicals
1 回表示 (過去 30 日間)
古いコメントを表示
what should i do to not get this error? >> Subscript indices must either be real positive integers or logicals.
1 件のコメント
per isakson
2017 年 8 月 8 日
Make sure that the values of sqrt(EbN0) and sqrt(2*EbN0) always are "real positive integers or logicals"
採用された回答
Walter Roberson
2017 年 8 月 8 日
Remember,
Q(sqrt(EbN0))
means to take the square root of EbN0, and then try to use that square root as an index into the variable Q (which is a scalar.) There is no implied multiplication in MATLAB: if you want
Q .* sqrt(EbN0)
then you have to write that.
2 件のコメント
the cyclist
2017 年 8 月 8 日
編集済み: the cyclist
2017 年 8 月 8 日
It looks like you ran that in the command window, but you did not actually fix line in your script g.m. You need to edit the script before you run it.
Also, you will need to fix the next line
Q .* sqrt(2*EbN0)
その他の回答 (2 件)
the cyclist
2017 年 8 月 8 日
It looks like you have somehow created a variable with the name sqrt, and you are inadvertently accessing that variable, rather than the sqrt function.
3 件のコメント
the cyclist
2017 年 8 月 8 日
Ah, you are right. I missed the evidence that the workspace didn't have an sqrt variable.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!