[Date Index]
[Thread Index]
[Author Index]
Re: Solving Polynomial equation
*To*: mathgroup at smc.vnet.net
*Subject*: [mg100968] Re: [mg100901] Solving Polynomial equation
*From*: Murray Eisenberg <murray at math.umass.edu>
*Date*: Thu, 18 Jun 2009 20:49:00 -0400 (EDT)
*Organization*: Mathematics & Statistics, Univ. of Mass./Amherst
*References*: <200906180850.EAA19763@smc.vnet.net>
*Reply-to*: murray at math.umass.edu
Let's say your Excel spreadsheet is abc.xls and it's in directory
e:\temp. Assume it has column headers a, b, c in row 1 and then the
data in columns below. (You didn't mention values of the constant c in
your quadratic, but I'll assume you have those, too; if not, you can
readily modify the following.)
(* say where file is *)
SetDirectory[e:/temp]
(* import spreadsheet data *)
abc = Import["abc.xls",{"Data",1}]
(* strip off first element, which is column headers *)
abc = Rest[abc]
(* set up form of quadratic eq'n in pure function... *)
(* ... and map onto the abc values *)
Solve[#[[1]] x^2+#[[2]] x + #[[3]]==0,x]&/@abc
As usual in Mathematica, you'll get the solutions in the form of lists
of rules, one list for each {a,b,c} triple.
kosal lee wrote:
> Hello
>
> I need help and I am new to Mathematica.
>
> Suppose I want to solve for the equation: aX^2 + bx +c ==0, however
> I have a list of parameters a and b in my microsoft excel where a and b are columns and its value are in rows.
>
> I dont want to key every a and b each time to find the root of above equation.
>
> Are there anyway to tell Mathematica to import each a and b value from excel, put it in the above equation, and find its root
> and it export the list of results back to excel?
>
>
> Thank you.
> Best Regards,
> Kosal
>
>
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
Prev by Date:
**Re: Huge wide plot placing into a pane**
Next by Date:
**Re: Hypergeometric2F1 gives wrong complex infinities**
Previous by thread:
**Solving Polynomial equation**
Next by thread:
**Re: Solving Polynomial equation**
| |