Determine the length of a 3D cell array (?) within a struct
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
Respuesta aceptada
Jan
el 17 de Sept. de 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 comentarios
Más respuestas (2)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!