Re: How to solve this simple equation?
- To: mathgroup at smc.vnet.net
- Subject: [mg87900] Re: How to solve this simple equation?
- From: "Jean-Marc Gulliet" <jeanmarc.gulliet at gmail.com>
- Date: Sat, 19 Apr 2008 23:49:34 -0400 (EDT)
- References: <fu1tvq$oi8$1@smc.vnet.net> <4804BF81.7000405@gmail.com>
On Sat, Apr 19, 2008 at 6:47 AM, Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com> wrote: > On Fri, Apr 18, 2008 at 9:04 AM, Dino de Blasio <dinodeblasio at gmail.com> wrote: <snip> > > How to import a column from excel 2007 in data format for mathematica? > > For example if I have: > > column1 = a b c d e f g h > > > > how I can obtain: > > data = {a,b,c,d,e,f,g,h} > > in mathematica? > > AFAIK, Mathematica does not handle Microsoft Excel 2007 file format > yet. So use an XLS or CSV file format, for instance. > > Assuming a file saved in XLS format that contains one sheet of 3 rows > by 4 columns, you can use Inport[] as follow: > > In[145]:= imp = Import["Workbook1.xls"] > > Out[145]= {{{11., 21., 31.}, {12., 22., 32.}, {13., 23., 33.}, {14., > 24., 34.}}} > > In[155]:= data = Transpose[Sequence @@ imp][[1]] > > Out[155]= {11., 12., 13., 14.} You can shorten those steps by telling Import[] what data you want to import. In the following example we import the values of the third column for all the lines that compose the second sheet of the Excel workbook. In[6]:= Import["Workbook1.xls", {"Data", 2, All, 3}] Out[6]= {213., 223., 233., 243.} HTH, -- Jean-Marc