From: W H on 13 Jan 2010 17:46 I currently have a long list of text in Excel (looks like the following: asdg rege wehgre grewe ger gresg gres hyrth htres ehre All of the text is in one column.) I'm looking for a way to import this list of text into matlab such that each line is its own cell in a text array. So far, the only way I've managed to get the text into Matlab is using fileread, but that just leaves me with one long string. Thanks!
From: Nathan on 13 Jan 2010 18:02 On Jan 13, 2:46 pm, "W H" <pidgwil...(a)aol.com> wrote: > I currently have a long list of text in Excel (looks like the following: > asdg > rege > wehgre > grewe > ger > > gresg > gres > hyrth > htres > > ehre > > All of the text is in one column.) I'm looking for a way to import this list of text into matlab such that each line is its own cell in a text array.. So far, the only way I've managed to get the text into Matlab is using fileread, but that just leaves me with one long string. Thanks! doc xlsread Note the output options. [num txt raw] = xlsread('yourexceldocument.xls') txt should be a cell array containing the text you describe. If your strings contain text AND numerical data, they will appear in the cell array titled raw -Nathan
From: W H on 13 Jan 2010 18:36 Nathan <ngreco32(a)gmail.com> wrote in message <2359a713-ae9f-40be-9f52-f01a2a785a56(a)34g2000yqp.googlegroups.com>... > On Jan 13, 2:46 pm, "W H" <pidgwil...(a)aol.com> wrote: > > I currently have a long list of text in Excel (looks like the following: > > asdg > > rege > > wehgre > > grewe > > ger > > > > gresg > > gres > > hyrth > > htres > > > > ehre > > > > All of the text is in one column.) I'm looking for a way to import this list of text into matlab such that each line is its own cell in a text array. So far, the only way I've managed to get the text into Matlab is using fileread, but that just leaves me with one long string. Thanks! > > doc xlsread > > Note the output options. > [num txt raw] = xlsread('yourexceldocument.xls') > > txt should be a cell array containing the text you describe. > If your strings contain text AND numerical data, they will appear in > the cell array titled raw > > > -Nathan Awesome, thanks. (Also, I'm running a 2008 version of MATLAB (7.7.0) on MAC OS snow leopard. Does this affect xlsread?) I'm getting the following error: Warning: XLSREAD has limited import functionality on non-Windows platforms or in basic mode. Refer to HELP XLSREAD for more information. > In xlsread at 194 Skipping Unicode formatted string. XLS File contains unrecognized string header - skipping remaining text - (1009:0x63 21). ??? Error using ==> xlsread at 207 File contains unexpected record length. Try saving as Excel 98. What is the maximum size of the excel file I can import? I got this message with a file with 1000s of rows, but it worked fine for a test file with 50 rows.
From: Nathan on 13 Jan 2010 18:55 On Jan 13, 3:36 pm, "W H" <pidgwil...(a)aol.com> wrote: > Nathan <ngrec...(a)gmail.com> wrote in message <2359a713-ae9f-40be-9f52-f01a2a785...(a)34g2000yqp.googlegroups.com>... > > On Jan 13, 2:46 pm, "W H" <pidgwil...(a)aol.com> wrote: > > > I currently have a long list of text in Excel (looks like the following: > > > asdg > > > rege > > > wehgre > > > grewe > > > ger > > > > gresg > > > gres > > > hyrth > > > htres > > > > ehre > > > > All of the text is in one column.) I'm looking for a way to import this list of text into matlab such that each line is its own cell in a text array. So far, the only way I've managed to get the text into Matlab is using fileread, but that just leaves me with one long string. Thanks! > > > doc xlsread > > > Note the output options. > > [num txt raw] = xlsread('yourexceldocument.xls') > > > txt should be a cell array containing the text you describe. > > If your strings contain text AND numerical data, they will appear in > > the cell array titled raw > > > -Nathan > > Awesome, thanks. > > (Also, I'm running a 2008 version of MATLAB (7.7.0) on MAC OS snow leopard. Does this affect xlsread?) I'm getting the following error: > > Warning: XLSREAD has limited import functionality on non-Windows platforms > or in basic mode. Refer to HELP XLSREAD for more information.> In xlsread at 194 > > Skipping Unicode formatted string. > XLS File contains unrecognized string header - skipping remaining text - (1009:0x63 21). > ??? Error using ==> xlsread at 207 > File contains unexpected record length. Try saving as Excel 98. > > What is the maximum size of the excel file I can import? I got this message with a file with 1000s of rows, but it worked fine for a test file with 50 rows. I'm not sure what the maximum size is. Someone here got your same error: http://www.mathworks.com/matlabcentral/newsreader/view_thread/59269 Using xlsread on MAC forces it to be used in "Basic" mode. Check the documentation: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xlsread.html I'm not sure as to how "basic" it goes, however. Even the support website wasn't too clear about that: http://www.mathworks.com/support/solutions/en/data/1-ZITZK/index.html?solution=1-ZITZK Sorry, but that's all I could find. -Nathan
From: W H on 13 Jan 2010 19:10 Nathan <ngreco32(a)gmail.com> wrote in message <2f1aa99e-15db-4177-9757-b196ede83469(a)j5g2000yqm.googlegroups.com>... > On Jan 13, 3:36 pm, "W H" <pidgwil...(a)aol.com> wrote: > > Nathan <ngrec...(a)gmail.com> wrote in message <2359a713-ae9f-40be-9f52-f01a2a785...(a)34g2000yqp.googlegroups.com>... > > > On Jan 13, 2:46 pm, "W H" <pidgwil...(a)aol.com> wrote: > > > > I currently have a long list of text in Excel (looks like the following: > > > > asdg > > > > rege > > > > wehgre > > > > grewe > > > > ger > > > > > > gresg > > > > gres > > > > hyrth > > > > htres > > > > > > ehre > > > > > > All of the text is in one column.) I'm looking for a way to import this list of text into matlab such that each line is its own cell in a text array. So far, the only way I've managed to get the text into Matlab is using fileread, but that just leaves me with one long string. Thanks! > > > > > doc xlsread > > > > > Note the output options. > > > [num txt raw] = xlsread('yourexceldocument.xls') > > > > > txt should be a cell array containing the text you describe. > > > If your strings contain text AND numerical data, they will appear in > > > the cell array titled raw > > > > > -Nathan > > > > Awesome, thanks. > > > > (Also, I'm running a 2008 version of MATLAB (7.7.0) on MAC OS snow leopard. Does this affect xlsread?) I'm getting the following error: > > > > Warning: XLSREAD has limited import functionality on non-Windows platforms > > or in basic mode. Refer to HELP XLSREAD for more information.> In xlsread at 194 > > > > Skipping Unicode formatted string. > > XLS File contains unrecognized string header - skipping remaining text - (1009:0x63 21). > > ??? Error using ==> xlsread at 207 > > File contains unexpected record length. Try saving as Excel 98. > > > > What is the maximum size of the excel file I can import? I got this message with a file with 1000s of rows, but it worked fine for a test file with 50 rows. > > I'm not sure what the maximum size is. > > Someone here got your same error: > http://www.mathworks.com/matlabcentral/newsreader/view_thread/59269 > > Using xlsread on MAC forces it to be used in "Basic" mode. > Check the documentation: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xlsread.html > I'm not sure as to how "basic" it goes, however. > > Even the support website wasn't too clear about that: > http://www.mathworks.com/support/solutions/en/data/1-ZITZK/index.html?solution=1-ZITZK > > Sorry, but that's all I could find. > > -Nathan K, thanks for your help!
|
Pages: 1 Prev: Efficient way of manipulating matrix Next: RBF neural network (newrb) passing parameters |