Access multiple structures within cell array

  • Follow


Hello. I have a cell array in which each cell has a structure array of the exact same kind. Is there any way to get at the information from a set of cells at once, or will I have to make a for loop? 

mycell{2,:}      gives me all the structures I want to look at

mycell{2,1}.info      gives me the data (a 10x1 matix) I want from a particular cell

mycell{2,:}.info      is what I am trying to do. 
0
Reply Steve 3/19/2011 8:48:04 PM

"Steve Sachay" wrote in message <im34q4$5rp$1@fred.mathworks.com>...
> Hello. I have a cell array in which each cell has a structure array of the exact same kind. Is there any way to get at the information from a set of cells at once, or will I have to make a for loop? 
> 
> mycell{2,:}      gives me all the structures I want to look at
> 
> mycell{2,1}.info      gives me the data (a 10x1 matix) I want from a particular cell
> 
> mycell{2,:}.info      is what I am trying to do. 

If the structures has similarity, why not store in struct array?

s = cat(2, mycell{2,:})
info = {s.info}

% Bruno
0
Reply Bruno 3/19/2011 9:30:20 PM


1 Replies
377 Views

(page loaded in 1.422 seconds)

Similiar Articles:













7/23/2012 5:31:02 PM


Reply: