Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
combined operations on struct arrays
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a struct S
S=struct()
It has 2 fields a,b
S(1).a=2;
S(2).a=3;
S(3).a=4;
now how do i do something like
S(:).a=S(:).a+[ 5 6 7 ]
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2013년 5월 1일
편집: Azzi Abdelmalek
2013년 5월 1일
S=struct('a',cellfun(@plus, {S.a},{5 6 7},'un',0))
댓글 수: 4
Azzi Abdelmalek
2013년 5월 1일
편집: Azzi Abdelmalek
2013년 5월 1일
What do you mean by readable?
doc cellfun
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!