필터 지우기
필터 지우기

summation of elements in multi dimensional matrix

조회 수: 1 (최근 30일)
fatema saba
fatema saba 2015년 1월 2일
댓글: fatema saba 2015년 1월 2일
Hi
any body there
I have a three dimensional matrix called C. dimension of this matrix is (3,3,k).
K is changeable. I want to create matrix D like that:
D=(C(:,:,1)+C(:,:,2)+....C(:,:,K)
K is changeable. and my be more than 30.
Thankyou

채택된 답변

Stephen23
Stephen23 2015년 1월 2일
편집: Stephen23 2015년 1월 2일
Use sum with its second optional argument:
D = sum(C,3)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by