Author Topic: "get" the return of solve  (Read 2236 times)

0 Members and 1 Guest are viewing this topic.

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
"get" the return of solve
« 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]
« Last Edit: June 17, 2011, 11:24:02 pm by kyllopardiun »

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: "get" the return of solve
« Reply #1 on: June 18, 2011, 01:00:21 am »
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.

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: "get" the return of solve
« Reply #2 on: June 18, 2011, 02:01:28 am »
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.   
« Last Edit: June 18, 2011, 02:02:12 am by kyllopardiun »

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: "get" the return of solve
« Reply #3 on: June 19, 2011, 03:19:18 pm »
No one knows how to write a variadic function in ti-basic? Is it impossible?