What does "Index exceeds the number of array elements (6)." mean?
Ältere Kommentare anzeigen
Hey everybody,
I have a problem concerning my recent work. I get the following error message:

I also attached the code if that helps.
I really have no idea what it is from and why it occures here... What can I do here to avoid the failure?
Thank you a lot in advance!!
Johnny
1 Kommentar
KSSV
am 16 Jun. 2020
xlfile is missing......code is huge...
Error is simple, you are trying to extract more number of elemnts then present.
Ex:
A = rand(6,1) ;
A(8)
Akzeptierte Antwort
Weitere Antworten (1)
Deepak Gupta
am 16 Jun. 2020
1 Stimme
Hello Jonathan,
It's hard to root cause the problem without having the xlsx sheet you are using in your program. But in general this error is thrown when you are trying to access an array index which doesn't exist. At line number 229, you are checking condition, for allepunkte = 1:8, and for that it throws error that index exceeds array size of 6. So program will throw error for any value greater than 6. Try allepunkte = 1:6 at this point and check if you still see error. It's not the solution, it's just a way to root cause the error.
If this doesn't throw error and you have to keep allepunkte = 1:8, then you need to investivate why you are not getting cell arrays of required size.
Hope this helps.
1 Kommentar
Jonathan Babitsch
am 16 Jun. 2020
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!