Skip to main content
14-Alexandrite
October 25, 2013
Question

This array index is invalid for this array

  • October 25, 2013
  • 1 reply
  • 5223 views

Hello,

In the attached Mathcad sheet, when you scroll about one third down , under section 5.1, i get the error"This array index is invalid for this array". i am not sure what the error is and how to fix it. it happens in all the areas under section (5.1).Any assitance will be appreciated. Thanks!

1 reply

25-Diamond I
October 25, 2013

Use "Trace error" to let you show the position of the error. Its in the sum above.

You are summing from 0 to n.P+1. n.P=20, so the max index is 21.

The sum uses vector P which has 22 elements and vector NC_a which has only 21 elements. So index 21 is invalid for vector NC_a.

Can't tell how to fix as I cannot be bothered wading through THAT file 😉

SFares14-AlexandriteAuthor
14-Alexandrite
October 25, 2013

you stated that vector P has 22 elements. how did you determine that?Thanks!

23-Emerald I
October 25, 2013

There are two useful commands:

rows(P) tells how many rows there are in a matrix or vector

cols(P) tells how many columns