Determine the length of a 3D cell array (?) within a struct
    1 view (last 30 days)
  
       Show older comments
    
Hi together,
you find a MATLAB file in the dropbox-link, containing a 1x1 struct M:
This struct contains cell-arrays d00 to d15 (I'm not sure if these are cell arrays or something else). Each d** has three dimensions.
The first two dimensios are 3 and 4 (3x4). The third dimension is varying from d** to d**.
I want to extract the entries of the third dimension within a loop. Therefor I have to determine the lentgh of this third dimension for every d**.
Somebody can give me some advice?
Thanks a lot for help in advance! Ka Me
Accepted Answer
  Jan
      
      
 on 17 Sep 2013
        The solution would be trivial, if you avoid using "d00", "d01" etc as names of the variables. Hiding an index in the name is a very bad idea, which provokes such troubles. Better use a cell: d{1}, d{2}, ... Then:
dim3 = cellfun('size', d, 3)
0 Comments
More Answers (2)
See Also
Categories
				Find more on Matrix Indexing in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
