Index exceeds matrix dimensions. Error in gtc21 (line 21) outputBits = mod(sum(sh​iftedValue​s(generato​rPolynomia​ls)), 2);

1 回表示 (過去 30 日間)
Amare
Amare 2024 年 6 月 29 日
コメント済み: DGM 2024 年 6 月 30 日
Index exceeds matrix dimensions.
Error in gtc21 (line 21)
outputBits = mod(sum(shiftedValues(generatorPolynomials)), 2);

回答 (1 件)

DGM
DGM 2024 年 6 月 30 日
編集済み: DGM 2024 年 6 月 30 日
Since you gave us no information, then the error message itself tells you everything that you could be told.
In whatever file gtc21.m is, the variable generatorPolynomials is ostensibly a scalar integer which is greater than the number of elements in shiftedValues, which is ostensibly an array of some unknown size. The index exceeds the number of elements in the array.
What size is shiftedValues, and why is generatorPolynomials greater than the number of elements in it? Nobody knows. Is gtc21.m your file, or is it some third party file that's being called improperly somewhere? Nobody knows.
  2 件のコメント
Walter Roberson
Walter Roberson 2024 年 6 月 30 日
It is also possible that a value has been assigned to a variable named sum or to a variable named mod
DGM
DGM 2024 年 6 月 30 日
That too.
In other words, somewhere there's an array, and somewhere there's an index. Either:
  • the array is inappropriately sized for the index
  • the index is inappropriate for the size of the array
  • or the "array" isn't even supposed to be an array.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by