Index exceeds Array Bounds - Help!
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Malte Räuchle
il 9 Giu 2020
Commentato: Malte Räuchle
il 10 Giu 2020
Hello everyone - I receive the error "Index exceeds array bounds" , but I can't solve the Problem.
I attache the file, and this is the Line which causes the error:
Pre_Time(idx_loopi).Durchschnittswert(counter,idx_act_Channel_Time)= mean(test(idx_loopi).Channels(idx_act_Channel_Time).Data(idxStart:i));
3 Commenti
Risposta accettata
Steven Lord
il 9 Giu 2020
Set an error breakpoint. Run your code. When MATLAB reaches the error breakpoint, check the size of v1.Durchschnittswert and the value of the counter variable. From that error message v1.Durchschnittswert will have ten rows and counter will be greater than 10.
Look back in your code to ensure that counter is being set correctly and v1.Durchschnittswert is being created and updated correctly. Did you delete a row from that variable when you didn't expect to, or did you assign into the wrong row of it (overwriting values instead of growing it?)
Once you know where the error occurs and understand what's going on, set breakpoints earlier in your code and step through, watching for the conditions that cause the error to appear.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!