- the structure in question
- what you tried
Counting number of rows in a field of structure
39 次查看(过去 30 天)
显示 更早的评论
Hi all!
I need to know how many rows are in a structure field.
The number of rows are not fixed. I try to use numel for counting the numbers inside any row but doesn't work.
I try too with size function but doesn't work either.
- * Message error: too many input/output arguments.**
How can i solve this?
Thanks for all!
0 个评论
回答(1 个)
dpb
2017-6-6
Well, that's an ambiguous question if ever were one...certainly for a given structure/field combination size works; we need to see an example of
>> s.f1=rand(3); % a sample structure with field f1
>> nr=size(s.f1,1); % number of rows in field content
ans =
3
>>
2 个评论
dpb
2017-6-9
Nothing attached; what would be better instead would be a .mat file containing a (small) set of the struct and a description of what you're try to retrieve and what you tried...we can't do anything with an image.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!