Determine the length of a 3D cell array (?) within a struct
1 次查看(过去 30 天)
显示 更早的评论
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
采纳的回答
Jan
2013-9-17
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 个评论
更多回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!