Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
i DON'T UNDERSTAND this error : ERROR ARRAY INDEX IS INVALID FOR THIS ARRAY
Do you can to help me.
Thank you
Solved! Go to Solution.
A slight modification makes it work in either case. With an odd number of elements the last element is ignored.
HEllo,
You say :
So, i should have last(Phase°)>last(tpas) ? Is that ?
What should I do to plot my chart?
Error simply means that you are trying to use an index for a vector that exceeds the maximum index you have defined. You have defined duree to run from 0 to 50.
But in the box that is generating the error your index 2*s+1 can go up to 51 if s=25.
The problem is that in the way you currently define it x can only really run from zero to 24 or you can modify it to run from 1 to 25. You would have to change your definition if you want to run it from zero to 25.
Another possibility of course is that could define a value duree(51) and that would solve the problem. However, that may not be a meaningful solution in your problem.
I could not see any other problems in the program other than a couple of charts not plotting, but that was only because you defined the variables below the chart. You obviously have to define them before you plot them.
Other than that check that you have set ORIGIN:=0 in you worksheet preferences.
Best of luck
dave
When I replied to your earlier post (http://communities.ptc.com/message/176748#176748) I assumed the input vector would always have an even number of elements. If it has an odd number of elements the expression for the upper limit of the loop returns an out of range index. But, based on your question, an odd number of elements does not make much sense. What do you want it to do if it has an odd number of elements? Just ignore the last one?
How ignore the last one ? Please
last(duree -1) ?
A slight modification makes it work in either case. With an odd number of elements the last element is ignored.
Thank you very much, all everyone