• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Is it possible to make an array perform maths

I was trying to get the cubic roots of an equation and was wondering if it was possible to set an array to the roots. If yes, how? If not, is there an alternative?
 
The thing is, I am trying to create an app that will get the eigenvalues of a matrix. I've managed to get its characteristic equation. The eigenvalues are the roots of this characteristic equation. If I find the roots using the following formula,
cubic.gif
I will get three different values which need to be assigned to a variable/array for me to be able to put them in a pop-up box. Could you please help me?
 
I for one do not understand your question.

If you provide values for a, b, c, and d your equation will apparently give you the calculated value x.

What is the question about a variable/array?

The way to learn Tasker is to do something simple ... when that works ... add to it. In essence you nibble away at creating the solution.

The best way to communicate your question is to post the Tasker task that you created.

... Thom
 
There are three possible values of x and I need them all! This is why I need to know if it should be assigned to an array/variable. I haven't begun working on that part yet.
 
I don't know much about tasker, but I do know about coding, and multiple values can not be assigned to a simple variable. You need an array data type.
 
I am still without a clue as to what the question is.

In Tasker you can store three values in three variables or one array with three elements, It is a question of how you like to think about your organization. An example ...

Dev3 (18)
A1: Variable Set [ Name:%one To:a Recurse Variables:Off Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%two To:b Recurse Variables:Off Do Maths:Off Append:Off ]
A3: Variable Set [ Name:%three To:c Recurse Variables:Off Do Maths:Off Append:Off ]
A4: Array Set [ Variable Array:%four Values:a,b,c Splitter:, ]
A5: Flash [ Text:%one - %two - %three Long:Off ]
A6: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A7: Flash [ Text:%four1 - %four2 - %four3 Long:Off ]

... Thom
 
An embarrassing mistake! I just realised there are a few more steps after the one mentioned above to yield three different results. I wish I'd never made this post. Extremely sorry for troubling you people. : (
 
An embarrassing mistake! I just realised there are a few more steps after the one mentioned above to yield three different results. I wish I'd never made this post. Extremely sorry for troubling you people. : (
No worries. Sometimes talking your way through it and being questioned leads to the answer. Happy you are all set. Maybe post the answer so if someone else find themselves in a similar spot will have a solution at hand. :)
 
Back
Top Bottom