Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Import Multiple Excel Files into Multiple files or One Single File
Replies: 1   Last Post: Nov 26, 2012 12:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
ryanshuell@gmail.com

Posts: 114
Registered: 2/11/08
Import Multiple Excel Files into Multiple files or One Single File
Posted: Nov 26, 2012 12:06 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I was fiddling around with the code below:
cd('C:\Users\Excel\Desktop\Excel_Files')
d = dir('*.xls');
nfiles = length(d);
data = [];
for k = 1:nfiles
num = xlsread(d(k).name);
end

It seems to import all files, but overwrites the data in the file, so only the last file imported is actually stored in the Matlab variable.

I am trying to figure out a way to import multiple files into multiple Matlab variables.
Also, I am trying to figure out a way to import multiple files into one single Matlab variable.

Can someone here give me the code to do that?

Thanks!!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.