How to find the maximum length in a structure of vectors?
34 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
その他の回答 (1 件)
Precise Simulation
2017 年 11 月 12 日
If by "maximum length" you mean the number of struct entries, then you can just use one of the standard length, numel, or size commands
length(fem)
numel(fem)
size(fem)
If you mean the maximum value in each struct entry you could use something like
mx_all = cellfun(@max,struct2cell(fem))
mx = max(mx_all(:))
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!