Determine the length of a 3D cell array (?) within a struct
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponse acceptée
Jan
le 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 commentaires
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!