cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

This array index is invalid for this array

hrishibhor
1-Visitor

This array index is invalid for this array

I need some help with a code I am writing.

I am getting an error

"This array index is invalid for this array"

attached is the code

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:hrishibhor)

Attached is that sheet. Could you please look through it. I think I am doing something wrong with the for loop but I might be wrong.

It's only a simple typo. At the begin of your i-loop you have written Y[i+i which should be Y[i+1.

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald III
(To:hrishibhor)

I think it might be because you have assigned the new value to Δudotdoti instead of udotdoti at the end of the for loop.

Stuart

You were right Stuart.

The reason I got confused was that I had a similar mathcad sheet (actually a complex version of what I sent earlier) which did not have the "udotdoti "error you caught but still showed similar error "This array index is invalid for this array"

Attached is that sheet. Could you please look through it. I think I am doing something wrong with the for loop but I might be wrong.

Appreciate your help.

For what ever reason, changing the range variable in your uuu() function from i to something else let the program work. (I don't understand why.)

Werner_E
25-Diamond I
(To:hrishibhor)

Attached is that sheet. Could you please look through it. I think I am doing something wrong with the for loop but I might be wrong.

It's only a simple typo. At the begin of your i-loop you have written Y[i+i which should be Y[i+1.

Announcements

Top Tags