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: 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: 17,944
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 " <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




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.