Prev: Problems in Simulink -> Code Compose Studio V3.3 (CCS) about toolbox C2000 when used RTDX functions
Next: Array in Array
From: Steph T on 11 Jun 2010 12:26 Hi there, I have a huge spreadsheet with 280 sheets, and each sheet has about 200x50 data points. Is there a way I can import this data into Matlab, whilst keeping each sheet as a separate variable? Many thanks, Steph
From: Fangjun Jiang on 11 Jun 2010 13:25 function xlsread can do just like that. help xlsread "Steph T" <stephanie.turnbull(a)strath.ac.uk> wrote in message <huto2t$pmi$1(a)fred.mathworks.com>... > Hi there, > > I have a huge spreadsheet with 280 sheets, and each sheet has about 200x50 data points. Is there a way I can import this data into Matlab, whilst keeping each sheet as a separate variable? > > Many thanks, > Steph
From: Steph T on 15 Jun 2010 05:13 But is there a way of using xlsread more efficiently, rather than having to use it 280 times? PS - sorry but I am rather new to Matlab, so humour me :)
From: sscnekro on 15 Jun 2010 07:50 > But is there a way of using xlsread more efficiently, rather than having to use it 280 times? That's a bit up to you. In what way are your data stored in the .xls file? E.g. if all the sheets are arranged the same way (so that ML can start reading data from the same range or cell), it simplifies a lot. Have you got ready 280 variable names, or do you still need to create them? What sort of variable do you prefer to create, matrix, cell array, structure...? Help doc: xlsread(), for loop, structures, field names, ... + browsing the web for some keywords will get to useful hints on other and these sites.
From: Steph T on 15 Jun 2010 08:51
"sscnekro " <stiahni.mail(a)zoznam.sk> wrote in message <hv7pe0$9jm$1(a)fred.mathworks.com>... > > But is there a way of using xlsread more efficiently, rather than having to use it 280 times? > > That's a bit up to you. In what way are your data stored in the .xls file? E.g. if all the sheets are arranged the same way (so that ML can start reading data from the same range or cell), it simplifies a lot. Have you got ready 280 variable names, or do you still need to create them? What sort of variable do you prefer to create, matrix, cell array, structure...? Help doc: xlsread(), for loop, structures, field names, ... + browsing the web for some keywords will get to useful hints on other and these sites. I have 280 identical sheets where I'd be extracting the whole sheet, each called p# where # is a sequential sheet number. Ideally I'd want to read, for example, sheet p1 into variable p1, sheet p2 into variable p3, etc. I don't have the variables created yet, and ideally I'd like each variable as separate matrices. |