Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10592 > unrolled thread

How to make Excel import symbolically

Started byMatti <matti_overmark@yahoo.se>
First post2012-06-22 07:05 +0000
Last post2012-06-24 08:27 +0000
Articles 4 — 4 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  How to make Excel import symbolically Matti <matti_overmark@yahoo.se> - 2012-06-22 07:05 +0000
    Re: How to make Excel import symbolically DC <b.gatessucks@gmail.com> - 2012-06-23 08:27 +0000
    Re: How to make Excel import symbolically "Nasser M. Abbasi" <nma@12000.org> - 2012-06-23 08:23 +0000
    Re: How to make Excel import symbolically David Reiss <dbreiss@gmail.com> - 2012-06-24 08:27 +0000

#10592 — How to make Excel import symbolically

FromMatti <matti_overmark@yahoo.se>
Date2012-06-22 07:05 +0000
SubjectHow to make Excel import symbolically
Message-ID<js15g0$kh4$1@smc.vnet.net>
Hi!
I am new to Mathematica 8 Home (Win 7 64) so I would be grateful for some help.

I am trying to import a matrix symbolically from Excel 2010 so that I can manipulate it further on.

I.e in Excel
aa  bb
cc  dd

When I use the Import command I get

{{{aa, bb},{cc, dd}}}

This is not an matrix, it's something else (I don't know what).

1. Can I import the symbolic matrix in one operation? or
2. Can I transform the {{{...}}} to a {{...}}?

TIA Matti

[toc] | [next] | [standalone]


#10607

FromDC <b.gatessucks@gmail.com>
Date2012-06-23 08:27 +0000
Message-ID<js3ul0$110$1@smc.vnet.net>
In reply to#10592
 {{...}} =  {{{...}}}[[1]]

[toc] | [prev] | [next] | [standalone]


#10610

From"Nasser M. Abbasi" <nma@12000.org>
Date2012-06-23 08:23 +0000
Message-ID<js3uea$v5$1@smc.vnet.net>
In reply to#10592
On 6/22/2012 2:05 AM, Matti wrote:

>
> When I use the Import command I get
>
> {{{aa, bb},{cc, dd}}}
>
> This is not an matrix, it's something else (I don't know what).
>
> 2. Can I transform the {{{...}}} to a {{...}}?
>

In[3]:= lis={{{aa,bb},{cc,dd}}};

Flatten[lis,1]

Out[4]= {{aa,bb},{cc,dd}}

or

In[5]:= lis[[1]]

Out[5]= {{aa,bb},{cc,dd}}


--Nasser

[toc] | [prev] | [next] | [standalone]


#10620

FromDavid Reiss <dbreiss@gmail.com>
Date2012-06-24 08:27 +0000
Message-ID<js6j1d$883$1@smc.vnet.net>
In reply to#10592
The reason why you get a list with a matrix in it is because
Mathematica imports the multiple sheets of an Excel file as a list
with each element in the list containing the data from each respective
sheet in the Excel file.

So what you got was a list will one entry in it (because your Excel
file only had one sheet in it), and that entry is the matrix of the
data that you are interested in.  To get that first element of the
list you just access it in one of the many ways suggested by the
answers already posted.

The simplest method, for your particular case is just

First[{{{aa, bb},{cc, dd}}}]

Which gives

{{aa, bb},{cc, dd}}

But, more importantly, it is now time for you to read the
documentation and learn about lists and the manipulation of them  The
Documentation Center is the place to start...

Best,
David



On Jun 22, 3:05 am, Matti <matti_overm...@yahoo.se> wrote:
> Hi!
> I am new to Mathematica 8 Home (Win 7 64) so I would be grateful for some help.
>
> I am trying to import a matrix symbolically from Excel 2010 so that I can manipulate it further on.
>
> I.e in Excel
> aa  bb
> cc  dd
>
> When I use the Import command I get
>
> {{{aa, bb},{cc, dd}}}
>
> This is not an matrix, it's something else (I don't know what).
>
> 1. Can I import the symbolic matrix in one operation? or
> 2. Can I transform the {{{...}}} to a {{...}}?
>
> TIA Matti

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web