How to rewrite a variable in a for cycle for Ti-Basic

Viewed 35

I'm trying to program a numerical method in my ti-89, in TI-Basic language, the problem is that when I overwrite the variable inside the loop it doesn't do it, I'm new to this language and I don't know if I'm omitting some detail behind

Item()
prgm

Input "f(x)",a                  //call the function in text mode
define s(z,t) = a               //convert the text into a function

local xa,ya                     //declare local variables
x->xa                           //assign values that I already have saved to local variables
y->ya

local i
For i,1,10
  s(xa,ya)->xa                  //evaluate the function, and I have to rewrite the first parameter
EndFor

EndPrgm

1 Answers

I'm not entirely sure what's causing the problem, but I would try using a list to store the data instead if that is all there is. You can rewrite the list and clear it easily. You can store strings in these lists as well. Lists can be edited at all times, which will fix your problem. Although this solution might not be as efficient, it should work. I don't have my calculator with me so I can't test it, sorry :(. These two functions below add things to the list and clear the list.

L1(x,y,z) 

ClrList L1

Good luck! TI-Basic can be difficult sometimes

Related