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

1 Ansicht (letzte 30 Tage)
Marek Endrizal
Marek Endrizal am 18 Okt. 2020
Kommentiert: Marek Endrizal am 18 Okt. 2020
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).

Antworten (1)

Alan Stevens
Alan Stevens am 18 Okt. 2020
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 Kommentare
Alan Stevens
Alan Stevens am 18 Okt. 2020
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 am 18 Okt. 2020
Thank you, I'll try to find solution ☺

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by