how to count values in an array of a structure C

9 ビュー (過去 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});
  1 件のコメント
JFz
JFz 2017 年 11 月 16 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by