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: structures multi-level indexing
Replies: 3   Last Post: Dec 12, 2008 4:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Daniel Walker

Posts: 33
Registered: 7/27/07
structures multi-level indexing
Posted: Dec 11, 2008 2:13 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear all,
I'm using quite often structures in matlab to organize my data. Unfortunately, one faces problems afterwards when trying to access this data with multi-level indices.
Does anybody have an idea, how to get such data without for-loops?
e.g.:

a(1).data=rand(10,1); a(2).data=rand(10,1);

a(:).data(2:4)
??? Scalar index required for this type of multi-level indexing.

the only possibility I see:
tmp = [a(:).data];
tmp(2:4,:)

Is there any other option/function? Sometimes cellfun,structfun... help and they are quite handy!

I would appreciate your comments
Daniel



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.