Question: Problem in loop says "illegal use of an object as a name"

I tried the following do loop

 for k from 1 to 4 do

s:=0

xmp:=lstt[indlax[k]]

s:=ym(x)+s

end do

 

 

where xmp is getting a numeric value from list "lstt" for each k

ym(x) is a piecewise function containing unknowns x and xmp,

what I would like to get is ym(x) for each k, and sum them up

 

but everytime, I run this loop, I will have this error message

Error, Got internal error in Typesetting:-Parse:-IsAMatOrVec : "illegal use of an object as a name"

 

but if I run these lines for individual k's without the do loop, I am fine.

 

Can anyone shed some light? Thanks...

Please Wait...