Hi,
I have a precip matrix 360 x 280 x 365 and I want to obtain the sum for all the values in (:,:,365). For example,
output = sum(precip(360x280x1)+precip(360x280x2)+precip(360x280x3)..+precip(360x280x365)
So, the output matrix should be, output = 360 x 280. Can anyone suggest me a methos in MATLAB?
Thanks in advance.

 채택된 답변

Matt J
Matt J 2015년 7월 14일
편집: Matt J 2015년 7월 14일

2 개 추천

output = sum(precip,3);

댓글 수: 3

Damith
Damith 2015년 7월 15일
Thanks.
hussain Palagiri
hussain Palagiri 2021년 11월 14일
How to get sum for only 90 pages out of 365 pages?
output = sum(precip(:,:,1:90),3);

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2015년 7월 14일

댓글:

2021년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by