sum filed in struct
조회 수: 5 (최근 30일)
이전 댓글 표시
채택된 답변
Paul
2023년 6월 3일
편집: Paul
2023년 6월 6일
% example data
Sis.PV = 20;
% Sis.PV = repmat(Sis.PV,1,82); % original incorrect line, expanded the field instead of the struct
Sis = repmat(Sis,1,82); % correct line, expands the struct
Sis
sum([Sis.PV])
댓글 수: 3
Paul
2023년 6월 3일
Yes, I used []. Read the tutorial at the link I provided in the answer for more info. And/or search the doc for "comma-separated lists".
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!