Index exceeds the number of array elements (1) ERROR - not sure why.

조회 수: 1 (최근 30일)
Wesser
Wesser 2021년 2월 25일
댓글: Wesser 2021년 2월 25일
I keep getting this error...but don't know why! It's a simple addition equation...for a series of vectors.
My code and excel data file are attached. Thank you for any and all help with this!!
>> WSBModel
Index exceeds the number of array elements (1).
Error in WSBModel (line 179)
Z1PumpTot(t)=S2(t)+S4(t)+S7(t)+S8(t)+S9(t)+S10(t)+S11(t)+S12(t)+S13(t)+S14(t)+...

채택된 답변

David Hill
David Hill 2021년 2월 25일
If you break your script at line 179, you can clearly see the problem. S10 is only a 1x1 array and needs to be a 49x1 like all the other variables. Something is wrong with S10.
  댓글 수: 1
Wesser
Wesser 2021년 2월 25일
I just saw this! Such a silly oversight! Thanks for your time!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by