What I'm trying to do is strip the columns from an excel file into separate variables for analysis. I know how to do it if I know the number of columns, then I can do it manually. What i would like is to do it using a for loop. This is what I have so far:
data = xlsread(fullfile(path,file)); N = size(data,2); M = size(data,1); for i = 1:N varname = strcat('data',num2str(i)); eval(sprintf('%s = %f',varname,data(:,i))); end
any help would be greatly appreciated.
Thanks, George
Best Answer