"Ryan " <firstname.lastname@example.org> wrote in message news:email@example.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.