summing element is a cell
이전 댓글 표시
I have a 1x50 cell 'c', where each element in the cell is a nxn matrix, how can I sum all 50 matrices (c{1}+c{2}+c{3}+.....c{50}) without a loop?
댓글 수: 1
Jos (10584)
2019년 3월 8일
"without a loop". Why?
Loops are efficient and easy and sometime the best option :-)
답변 (1개)
Stephen23
2019년 3월 5일
0 개 추천
sum(cat(3,c{:}),3)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!