Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: kyllopardiun on June 17, 2011, 11:08:53 pm
-
Well, I was doing some easy algorithm (frobenius method);
and I got an issue, I have a list like this: {a0+6*a1,a1+20*a2,a2+42*a3,a3,...}
And I must get it solved in terms of a0;
I can do this with: solve(list[1]=0 and list[2]=0 and list[3]=0 ...,a1,a2)
and the return is:
a1=−a0/6 and a2=a0/120 and a3=−a0/5040...
The question is can I store those "results" in a list? //sorry if is a dumb question but I couldn't find any example of this.
EDIT:
Someone know how to use variadic functions/programs like:
median(List[,freqlist])
?
// Nspire CAS 1.7 [this is the only version I can have working in computer for free besides ncubate]
-
Can you store the result of solve in a string?
For median(), if you just have one list, say [1,2,3,4,5], it will give you the median, 3 in this case. If you have a frequency list to go with the main list, say [4,2,1,1,3], it will expand the list to [1,1,1,1,2,2,3,4,5,5,5], and compute the median of that; it is like having a histogram, with the main list being the numbers along the bottom, and the freqlist being the values on the bars.
-
Can you store the result of solve in a string?
Actually I need it as values, however, maybe i can get through this with some workaround;
So If I do this, "solve()=:a", it is stored as string ?
Sorry If I was ambiguous, but I didn't ask how to use median,
What I am looking for is: to create a function which can be called like->
f(x)
and
f(x,y)
// Actually this is polymorphism for OO languages or variadic functions as called in ansi C.
-
No one knows how to write a variadic function in ti-basic? Is it impossible?