|
|
Re: Importing .xlsx files in parallels
Posted:
Mar 10, 2013 10:46 PM
|
|
"Ryan " <ryanshuell@gmail.com> wrote in message news:khef06$2c0$1@newscl01ah.mathworks.com... > Sorry, but it looks like the last M-code sample that I posted does NOT > import all Excel files in a folder. Well, at least I couldn't get it to > work. This, however, does work. > > % % Import all excel files in a folder into multiple Matlab variables. > % % Your variables will be num1, num2, ...etc > d = dir('C:\Users\Ryan\Desktop\Excel_Files\*.xls*'); nfiles = length(d); > for k = 1:nfiles > n=int2str(k); > eval(['[num' n ', txt' n ', raw' n '] = xlsread(d(k).name,1);']);
Don't do this! See question 6 in the Programming section of the newsgroup FAQ for an explanation why this is a Bad Idea and alternatives you should use instead. Question 12 in that same section may also be of interest.
http://matlab.wikia.com/wiki/FAQ
*snip*
-- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
|