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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Array index invalid.

loittinen
1-Newbie

Array index invalid.

Hey so I posted some time a go and i got help really nicely. THX for that.

I am working on a simulation but I cannot get it to work because of the error (this array index invalid for this array.)

I dont know how to fix it can someone help me?

THX.

6 REPLIES 6
StuartBruff
23-Emerald II
(To:loittinen)

Do you have any test data to use with your function?  It's difficult to tell what the problem is without seeing it in action.

Stuart

The problem is with the alfha dots that are in the definition on C_L and C_m and in alfha dot. i had a mistake in my code and that i had the alfha dot replised by just alfhas. and when i tried to undo my mistake i always get this array invalid message-

StuartBruff
23-Emerald II
(To:loittinen)

I'd already found the source of the (initial) problem by the time I read your reply.  You have a lot arrays with the "." subscript as well as index.   Some of the variable name also have a subscript "." but following characters, which makes it difficult to tell at first glance whether you meant N. or N - they look the same.

Stuart

The same error. The alfha . is a different variable then the alfha so... Cannot do the recommended changes.

StuartBruff
23-Emerald II
(To:loittinen)

Lauri Oittinen wrote:

The same error. The alfha . is a different variable then the alfha so... Cannot do the recommended changes.

Doh!  I have absolutely no idea what I was  thinking of yesterday.  For some reason or other I'd got it into my head that I was looking at a function ... I'll blame the cough I've had for the past couple of days ... Yes, that sounds like a good excuse .. well, it better than just plain stupidity!

I found the problem within about 5 seconds of looking at it tonight.  You had initialized α.0 but didn't increment the array index of α. in the loop, so the program was trying to get the value of α.1 in the second iteration of the loop, and α.1 didn't exist.

Stuart

no worries. Thx for the help now it looks like its working good. It was really hard to fing the mistakes from my own code so A BIG THX.

Top Tags