The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Importing .xlsx files in parallels
Replies: 8   Last Post: Mar 10, 2013 10:46 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: Importing .xlsx files in parallels
Posted: Mar 10, 2013 10:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ryan " <> wrote in message
> 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.


Steve Lord
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.