필터 지우기
필터 지우기

matrix addition

조회 수: 3 (최근 30일)
Jim O'Doherty
Jim O'Doherty 2011년 11월 28일
All, I've got a 3-d matrix, sum_total(:,:,i) "i" is in a loop, and can be anything from 20 to 100, therefore making the length unknown until after the loop is finished.
Does anyone know how I might add all the matrices of the variable together to make a single matrix? I tried "cumsum" with no luck.
Jim

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 28일
A=rand(3,4,5);
B=sum(A,3); % sum at the third dimension.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by