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: Multiple files into Matlab from Excel
Replies: 15   Last Post: May 9, 2014 2:06 AM

Advanced Search

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

Posts: 1,069
Registered: 9/26/13
Re: Multiple files into Matlab from Excel
Posted: May 6, 2014 9:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


"Michelle " <mictom@kth.se> wrote in message
news:lka9ak$pe2$1@newscl01ah.mathworks.com...
> "Steven Lord" <Steven_Lord@mathworks.com> wrote in message
> <lk86dd$5pb$1@newscl01ah.mathworks.com>...


*snip*

> Hi,
> thanks so much for the help, but I do not understand what you mean by ">
> Again, why? While it is possible to mix cell arrays and struct arrays,
> that

>> can get complicated really quickly. I recommend you stick with using cell
>> arrays alone."


You already have the data from your source files; you read them into the
cells of a.

>> > a{i}=xlsread(source_files(i).name)

This line is IMO unnecessary.

>> > aa{1+i}.data=xlsread(source_files(i+1).name);

In my experience, newer users find it (relatively) easy to understand plain
old numeric arrays. Struct arrays aren't much more difficult, at least
scalar struct arrays. Cell arrays represent a significant step up in
difficulty of understanding, mainly because of the two different types of
indexing that look very similar but behave differently enough. A cell array
containing a struct array is even further up the learning curve. Since you
don't actually NEED to use a cell array containing a struct array (in that
you already have the data you would access that way in another form) I
recommend that you NOT use such a construct unless that requirement is being
imposed upon you (by your professor, if this is a homework or school lab
assignment; by the requirements of code that your code will call, if you
can't modify the downstream code; etc.)

--
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.