Index in position 2 exceeds array bounds (must not exceed 14).

1 回表示 (過去 30 日間)
Marek Endrizal
Marek Endrizal 2020 年 10 月 18 日
コメント済み: Marek Endrizal 2020 年 10 月 18 日
C(1,1)= 1; C(1,10) =-1; C(1,16) = 1
C(2,2) = 1; C(2,10) = 1; C(2,11) =-1;
C(3,3) = 1; C(3,11) = 1; C(3,12) = -1;
C(4,4) = 1; C(4,8) = 1; C(4,13) = -1;
C(5,5) = 1; C(5,4) = 1; C(5,14) = -1;
C(6,6) = 1; C(6,8) = 1; C(6,9) = 1; C(6,15) = 1;
C(7,7) = 1; C(7,15) = 1; C(7,16) = -1;
C(8,8) = 1; C(8,17) = -1;
C(9,9) = 1; C(9,17) = 1;
----------------------------------------------------------------
>> C(9,17)
Index in position 2 exceeds array bounds (must not exceed 14).

回答 (1 件)

Alan Stevens
Alan Stevens 2020 年 10 月 18 日
Odd! It works for me:
>> C(1,1)= 1; C(1,10) =-1; C(1,16) = 1;
C(2,2) = 1; C(2,10) = 1; C(2,11) =-1;
C(3,3) = 1; C(3,11) = 1; C(3,12) = -1;
C(4,4) = 1; C(4,8) = 1; C(4,13) = -1;
C(5,5) = 1; C(5,4) = 1; C(5,14) = -1;
C(6,6) = 1; C(6,8) = 1; C(6,9) = 1; C(6,15) = 1;
C(7,7) = 1; C(7,15) = 1; C(7,16) = -1;
C(8,8) = 1; C(8,17) = -1;
C(9,9) = 1; C(9,17) = 1;
>> C(9,17)
ans =
1
  3 件のコメント
Alan Stevens
Alan Stevens 2020 年 10 月 18 日
I don't know! The only change I made was to put a semicolon after C(1,16), but I can't imagine that made a real difference!
Marek Endrizal
Marek Endrizal 2020 年 10 月 18 日
Thank you, I'll try to find solution ☺

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

カテゴリ

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