필터 지우기
필터 지우기

How to take an average of three dimensional data?

조회 수: 16 (최근 30일)
SONI SONI
SONI SONI 2018년 3월 14일
댓글: Walter Roberson 2021년 8월 16일
Hi,
I have a three-dimensional matrix (360 x 720 x 60), in this matrix 60 represents monthly data of 5yeras (for example monthly temperature). I want to take the annual average of these monthly values so that the final matrix will be 360 x 720 x 5.

채택된 답변

James Tursa
James Tursa 2018년 3월 14일
x = your 3D matrix
result = mean(reshape(x,360,720,12,5),3);
  댓글 수: 7
elliot brooksbank
elliot brooksbank 2021년 8월 16일
Hi james
i have a similiar dataset but the matrix is (30x17x456) the 456 represents months i need the monthly average temperature for each month
Walter Roberson
Walter Roberson 2021년 8월 16일
mean(yourmatrix, [1 2])
%or
mean(reshape(yourmatrix, [], size(YourMatrix,3)))

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by