1

I use mathcad program. I want to have "sys_r" graph. graph shape example below enter image description here

I try a below programming.

enter image description here

But programming error occurred. programming error!

Error is "This array index is invalid for this array."

I don't know solution. Please help me.

please........

Spencer Wieczorek
  • 21,229
  • 7
  • 44
  • 54
remmy
  • 21
  • 1
  • 5

1 Answers1

1

You've got an error in your for loop. j goes from 0 to 2, so j+1 can take the value 3, which is an invalid index for the matrix (it is a 3x3 matrix, not a 4x4 one). Hence the "invalid index" out-of-bounds access error.

Your outer for loop will cause an out-of-bounds access error too, even if you fix this, because i goes from 1 to 3.

If you weren't aware of that, matrices (and vectors) in Mathcad are indexed beginning with 0, just like in any other programming language. So, the valid indexes for your matrix are from 0 to 2 inclusive in both dimensions.