Adding data in cells
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a cell array size(C)= 42 1 C= [31*32 double] [31*32 double] [31*32 double] [31*32 double] . . .
I want to add all these cells in such a way that the final cell which i obtain is same size [31 * 32] as individual cells having the values added on same positions.
댓글 수: 0
답변 (2개)
Yoav Livneh
2011년 3월 22일
There's probably a way to do this without for loops but this is my suggestion:
L=length(C);
MatSize=size(C{1});
D=zeros(MatSize);
for jj=1:L
D=D+C{jj};
end
댓글 수: 0
Paulo Silva
2011년 3월 22일
C{end+1}=C{1:end};
This will add another cell to C that's the sum of the previous cells.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!