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: structures multi-level indexing
Replies: 4   Last Post: Mar 23, 2015 3:45 PM

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?

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

??? Scalar index required for this type of multi-level indexing.

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

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

I would appreciate your comments

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.