How to find the maximum length in a structure of vectors?
조회 수: 10 (최근 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!