how to count values in an array of a structure C

조회 수: 2 (최근 30일)
JFz
JFz 2017년 11월 16일
댓글: JFz 2017년 11월 16일
I have an array of structure C of 5 elements. 'Values' is an array of doubles in each C(i). The numbers vary. How to count the number of Values in the array C, as a vector? I tried val_count = numl(C.Values) but it returns 5. But it returns one number--5. I expected to get an array of 5 with various integers for the Values in each C(i).

채택된 답변

Matt J
Matt J 2017년 11월 16일
val_count = cellfun(@numel, {C.Values});

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by