Sum all the Channels in matrix

조회 수: 2 (최근 30일)
Aravin
Aravin 2012년 9월 16일
Hello everyone,
Let say I have a matrix M of 100 x 100 x 5. How can I sum all the channels of M and get one matrix R of size 100 x 100 only. I want to do it without loops.

채택된 답변

Rick Rosson
Rick Rosson 2012년 9월 16일

추가 답변 (1개)

Wayne King
Wayne King 2012년 9월 16일
편집: Wayne King 2012년 9월 16일
M = randn(100,100,5);
R = sum(M,3);
Did you read the help for sum?
  댓글 수: 1
Aravin
Aravin 2012년 9월 16일
Thanks. I forget to see the man for sum

댓글을 달려면 로그인하십시오.

카테고리

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